Forum Discussion
Issue with DAX calculation (RANK) on a specific aggregation level
Hi DZet ,
According to your description, here are my steps you can follow as a solution.
(1) My test data is the same as yours.
(2) We can create a measure.
Measure = var _sellrank = SELECTEDVALUE('Sales'[SellRank])
var _t =DISTINCT(SELECTCOLUMNS( FILTER(ALLSELECTED( 'Sales') , 'Sales'[SellRank] <= _sellrank) ,"rank" , [SellRank]))
return
COUNTROWS(_t)
(3) Then the result is as follows.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- DZet3 years agoNew Member
Hi!
Unfortunately, it's still not correct. As I described, this rank should be kind of YTD, so limited not straight by the slicer, but by such date range:var MaxDt = MAX(DateDim[Date]) var MinDt = DATE(YEAR(MaxDt), 1, 1)The slicer limits MaxDt, but we create ranking starting from Jan 1st. And that's the hardest part, I don't know how to change this filter context.
- Anonymous3 years agoNot applicable
Hi DZet ,
You can try to add multiple fields to a hierarchy slicer.
Please refer to the following document for more information:
Slicers in Power BI - Power BI | Microsoft Learn
Add multiple fields to a hierarchy slicer - Power BI | Microsoft Learn
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.