March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
I have the following Tables
dim Date, Dim Group, Fact
DAX Expression
Solved! Go to Solution.
HI @DebbieE
ALLSELECTED() will preserve the filters coming from outside the visuals so the filters for year and group will still be applied.
If you are using date dimension in your model, then you should have a Month Column and use it and Month Sort Column in SUMMARIZE ( )
Please see my Measure and outcome below.
Ive managed to rejig my script using the above info thankyou
Hi @DebbieE
Try something like this.
Rank = VAR _tbl = SUMMARIZE( ALLSELECTED( yourFactTable ), 'dim Date'[date].[Month] , 'dim Group'[Group] ) RETURN RANKX( _tbl, [Avg Fact],, DESC, Dense )
Its not worked
And its not ranking the Percentages Correctly.
There are 2 other things Im doing that may be affecting it
1. There is a Slicer in the report on year 2019
2. There is visual filter selecting 3 groups, so some groups are missing.
Im begining to worry that I cant do this in DAX
Hi @DebbieE
Can you create and share a data sample?
Many Thanks
Unfortunately not, The way this form works , I cant share data from our One Drive
HI @DebbieE
Try the below.
Rank = IF( NOT ISBLANK( [Avg Fact] ), VAR _tbl = CALCULATETABLE( VALUES( 'dim Date'[date].[Month] ), ALLSELECTED() ) RETURN RANKX( _tbl, [Avg Fact],, DESC, Dense ) )
Its got rid of the rank against null which is great but all the ranks are 1
So what I want is for Plan Jan = 1, Feb = 3 , March = 2
Again, Ive got a filter on Group so it only choses those 3 groups and a Slicer on Year
Hi @DebbieE
Try the below, or if your original measure worked fine, just add IF( NOT ISBLANK( [Avg Fact] ), Your Measure )
Measure = Rank = IF( NOT ISBLANK( [Avg Fact] ), VAR _tbl = CALCULATETABLE( SUMMARIZE( 'dim Date', 'dim Date'[MonthColumn], 'dim Date'[MonthSortColumn] ), ALLSELECTED() ) RETURN RANKX( _tbl, [Avg Fact],, DESC, Dense ) )
Im unsure where the month sort column has come from ?
Im using Month from the date hierarchy
Ive tried the following but it just sets everything as 1
HI @DebbieE
ALLSELECTED() will preserve the filters coming from outside the visuals so the filters for year and group will still be applied.
If you are using date dimension in your model, then you should have a Month Column and use it and Month Sort Column in SUMMARIZE ( )
Please see my Measure and outcome below.
Ive managed to rejig my script using the above info thankyou
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
89 | |
84 | |
70 | |
51 |
User | Count |
---|---|
206 | |
143 | |
97 | |
79 | |
68 |