cancel
Showing results for
Did you mean:

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Frequent Visitor

## how to use a ranking dax measure as a filter

Hello everybody! I created a dax measure to calculate how much customers spent in different fiscal years and another dax measure to rank these customers based on their spending. I would like to use slicer (picture below)

so that in a table, for example, it only shows customers classified as "K", "A", "B" or "C". But this visual does not accept DAX measures.

Below is my measure that makes the classification of customers:

Classificação Cliente Peças =
RETURN
SWITCH(
TRUE(),
TotalServicos >= 1000000, REPT(UNICHAR(8203),1) & "K",
TotalServicos >= 300000 && TotalServicos < 1000000, REPT(UNICHAR(8203),2) & "A",
TotalServicos >= 50000 && TotalServicos < 300000, REPT(UNICHAR(8203),3) & "B",
TotalServicos < 50000, REPT(UNICHAR(8203),4) & "C",
BLANK()
)

What can I do to be able to filter based on the client's class?
1 ACCEPTED SOLUTION
Community Support

You can try the following methods.
Create a new slicer table:

``Measure = IF(SELECTEDVALUE(Slicer[Slicer])=BLANK(),1,IF(SELECTEDVALUE(Slicer[Slicer])=[Classificação Cliente Peças],1,0))``

You can filter the views by this method.

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

4 REPLIES 4
Community Support

You can try the following methods.
Create a new slicer table:

``Measure = IF(SELECTEDVALUE(Slicer[Slicer])=BLANK(),1,IF(SELECTEDVALUE(Slicer[Slicer])=[Classificação Cliente Peças],1,0))``

You can filter the views by this method.

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Frequent Visitor

Hi @v-zhangti, I have a similar problem. The strategy worked to visualize the data in a table, but it doesn't work on a card, as it is not possible to put "Filtros_Peças is 1 ". Can you help me?

Frequent Visitor

Hello @v-zhangti , thanks for the help! I don't know why, but he's not behaving the same way he did with you.

I created a table with the classes and followed the same steps.

Frequent Visitor

The problem was REPT(), it worked, thank you!

Announcements

#### Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

#### Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

#### Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors