Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi all,
I have a sum measure and a RankX measure based on the Sum Measure. Now I want to create a measure which uses the output of the Rankx Measure to change this number in order to be able to create A podium visual with a bar chart.
My data looks like this:
Category | Sum of sales | Rank | Desired measure result |
A | 1200 | 3 | 3 |
B | 1500 | 1 | 2 |
C | 1300 | 2 | 1 |
So If the Rank = 1 then 2, IF rank =2 then 1, IF rank =3 then 3
I Tried to use the following formula but it returns only 2 probably because of the row filter context.
Hope you can help me
Solved! Go to Solution.
It should work. Did you use correct syntax of SWITCH funtion?
should be
SWITCH (
TEUE ( ),
Measure = SWITCH([RANK],1,2,2,1,3)
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
It should work. Did you use correct syntax of SWITCH funtion?
should be
SWITCH (
TEUE ( ),
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
9 | |
8 | |
6 | |
5 |
User | Count |
---|---|
17 | |
14 | |
10 | |
9 | |
6 |