Skip to main content
cancel
Showing results for 
Search instead 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.

Reply
Anonymous
Not applicable

RANKX Customer, Profit & Transaction Date

I have a problem with RANKX.

 

I am currently connecting to a Tabular Model and I'm attempting to rank the profit of each customer depending on the date. I am using this formula:

 

Rank = RANKX(ALLSELECTED(Customer[Customer_Label]),CALCULATE([Profit]))
 
The tabular model is a Star schema with the Fact_Profit table being joined to both the Customer and Date tables.
 
This works perfectly, with the exception of 2020 and 2021 as these return only a '1':
 
DAX.png
 
If you look at the Profit value in the same table it looks like the following:
 
DAX2.png
 
And I presume the reason the RANKX retrieves '1' for 2020 and 2021 is that another measure within the Profit table returns data for future years (a forecasting value).
 
So how would I modify the RANKX formula to filter out both 2020 and 2021. I've tried various formulas without much luck and so any help would be greatly appreciated.
2 REPLIES 2
v-chuncz-msft
Community Support
Community Support

@Anonymous ,

 

It seems that you may simply try Visual level filters.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Thanks

 

I know I can simply filter the data out, but I'm actually trying to understand how I can do this without the use of slicers and through the use of DAX if possible.

 

Kind Regards

Helpful resources

Announcements
Microsoft Fabric Learn Together

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

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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