Johnny Spindler
Johnny Spindler

Reputation: 456

Filter slicer using a measure

In my report I use two tables "NomData" and "ReadData_Perm".
enter image description here

I have a measure to identifie my needed EventTypeCodes by UserLogin:

FilterEventByUser = 
IF(
    MAX(dlg_V_User_ReadData_Perm[UserLogin]) = USERPRINCIPALNAME()
    && MAX(dlg_V_User_ReadData_Perm[EventTypeCode]) = MAX(Nomenklaturen[EventTypeCode])
    //MAXX(dlg_V_User_ReadData_Perm, dlg_V_User_ReadData_Perm[UserLogin]) = USERPRINCIPALNAME()
    //&& MAXX(dlg_V_User_ReadData_Perm, dlg_V_User_ReadData_Perm[EventTypeCode]) = MAXX(Nomenklaturen, Nomenklaturen[EventTypeCode])
   , 1, 0
)

When I use this measure as a filter on a table-visual it works just fine.
enter image description here enter image description here

But when I apply the same filter on a Slicer all my EventTypeCodes disappear.
enter image description here

As you can see I have tried MAX and MAXX but it works only on the table-visual. How can I apply the measure as a filter for my slicer?

Please let me know. Here is some example data (Replace [email protected] with you Login for testing):

EventTypeCode;Account
11;Piers
11;Elizabeth
13;Neil
13;Melanie
13;Joshua
14;Madeleine

UserLogin;EventTypeCode
[email protected];11
[email protected];14
[email protected];13

Upvotes: 0

Views: 32

Answers (2)

Johnny Spindler
Johnny Spindler

Reputation: 456

My problem seams to be the USERPRINCIPALNAME(). Row level security made the problem obsolete.

Upvotes: 0

Amandine FAURILLOU
Amandine FAURILLOU

Reputation: 612

I don't have the specific answer you are looking for, but I do have a workaround. I would use bookmarks as a way to filter by your measure. I seem to remember having difficulties filtering by a measure as it only returns one value depending on context and not a list of values.

You need to filter you visual with your first measure value, add a bookmark, then repeat for as many values as you have. Then add a bookmark navigator.

https://learn.microsoft.com/en-us/power-bi/create-reports/button-navigators?tabs=powerbi-desktop

Upvotes: 0

Related Questions