Denis
Denis

Reputation: 781

DAX: how to ignore slicer for particular measure

Data model & dashboard:

enter image description here

Intention: to prevent table visual from resizing due to slicing

Desired outcome:

enter image description here

Link to .pbi:

P.S. Tons of videos watched, but still can't resolve...

Of course in real life model is a bit more complicated.

Currently have to use dirty workaround which includes copy of Id column related with original one with unnatural 1:N relationship (to prevent filtering) and measure with selectedvalue for Num column

Upvotes: 0

Views: 3408

Answers (1)

Alexis Olson
Alexis Olson

Reputation: 40204

You're sort of skirting the generally intended behavior of slicers, so this isn't quite as simple as you might think it ought to be.

To do this, create a new disconnected parameter table for the IDs:

dimID = VALUES(Table1[Id])

Use this new table for your slicer and write a measure that reads these values.

SumNum =
CALCULATE (
    SUM ( Table1[Num] ),
    KEEPFILTERS ( Table1[Id] IN VALUES ( dimID[Id] ) )
)

Put this in your table and it should behave as expected provided you set 'Show items with no data' on the Table1[Id] column.

Menu screenshot

Result:

Result screenshot

Upvotes: 1

Related Questions