Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Anonymous
Not applicable

Filtered by certain slicer

Hi Experts, 

 

In my dashboard, there is a Measure (Measure_Rank) which ranked the customer by frequency.  

Dax is as follow:

 

Frequency = DISTINCTCOUNT('Table'[Date])
Measure_Rank = 
VAR newtable = SUMMARIZE ( ALLSELECTED ( 'Table' ), 'Table'[Customer ID] )
RETURN RANKX ( newtable, [Frequency],, ASC ) - 1

I want the Measure_Rank vary by Date and Centre Code only,
Pcode slicer is allowed to filter the central table, but it cannot affect the Rank result. 
SimonChung_GGGG_0-1646576845684.png

In my case I cannot use editing the visual interations, because the result is not the end, it will affect the latter part.

Wish anyone can help!! thank so much!!

 

Please find the PBIX here: RFM Demo 4.pbix

1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

Please try the following formula:

 

 

Measure = CALCULATE ( [Measure_Rank], REMOVEFILTERS ( 'Table'[Pcode] ) )

 

vkkfmsft_0-1646799105067.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I uderstood your question correctly, but please try the below measure.

 

Measure_Rank =
VAR newtable =
CALCULATETABLE (
SUMMARIZE ( ALLSELECTED ( 'Table' ), 'Table'[Customer ID] ),
REMOVEFILTERS ( 'Table'[Pcode] )
)
RETURN
RANKX ( newtable, [Frequency],, ASC ) - 1

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

Anonymous
Not applicable

@Jihwan_Kim Really really thank you, it works. it's exactly what I want!
However, I found that I have to lock measure Frequency too, otherwise the result will be weird.
I tried a similar way, but cannot, could you help me again? (  ̄十 ̄)

Frequency = DISTINCTCOUNT('Table'[Date])

 Thanks so much

Hi @Anonymous ,

 

Please try the following formula:

 

 

Measure = CALCULATE ( [Measure_Rank], REMOVEFILTERS ( 'Table'[Pcode] ) )

 

vkkfmsft_0-1646799105067.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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