The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi,
I am trying to Rank data in Power BI. Pictures is a meature. Now i want to create a measure to rank Pictures. The location with the highest pictures should be 1 and so on.
Please help me.
Solved! Go to Solution.
Actually, it could be that you're referencing the table without the column in the ALLSELECTED.
Try this...
_Measure =
RANKX (
ALLSELECTED ( 'Table'[Location] ),
'Table'[Pictures],
,
DESC,
SKIP
)
Have I solved your problem? Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;). |
If you found this post helpful, please give Kudos. It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen. If you find my signature vaguely amusing, please give Kudos. | Proud to be a Super User! |
If I understand correctly, this measure should work.
(change [Measure] to whatever you've called it)
RankPictures =
SWITCH(
TRUE(),
[Measure] < 21, 1,
[Measure] < 51, 0.7,
[Measure] < 101, 0.5,
[Measure] < 201, 0.3,
0
)
Please mark all the responses that solved your issues as the solution.
Have I solved your problem? Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;). |
If you found this post helpful, please give Kudos. It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen. If you find my signature vaguely amusing, please give Kudos. | Proud to be a Super User! |
Thank You!
Hi @Cevola,
Just a couple of things first.
You've posted a DAX question in the Power Query forum. You'll probably get an answer quicker if posted in the DAX forum.
Please paste data next time, not a screen shot. It makes it faster to come up with a solution.
As for the solution, I've thrown together a very simple example, attached.
The code should be working fine which leads me to believe the issue is with your model.
Can you post a screen shot of your model and the relationships?
Thanks
Have I solved your problem? Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;). |
If you found this post helpful, please give Kudos. It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen. If you find my signature vaguely amusing, please give Kudos. | Proud to be a Super User! |
Actually, it could be that you're referencing the table without the column in the ALLSELECTED.
Try this...
_Measure =
RANKX (
ALLSELECTED ( 'Table'[Location] ),
'Table'[Pictures],
,
DESC,
SKIP
)
Have I solved your problem? Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;). |
If you found this post helpful, please give Kudos. It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen. If you find my signature vaguely amusing, please give Kudos. | Proud to be a Super User! |
Thank You, your measure worked like magic.
Now, I need to create one more measure to Rank the pictures
Rank of:
Pictures –
top 20 = 1
Top 50 = 0.7
Top 100 = 0.5
Top 200 = 0.3
Can you please help me in this?
Thanks a lot in advance
Top 200 = 0.3
If I understand correctly, this measure should work.
(change [Measure] to whatever you've called it)
RankPictures =
SWITCH(
TRUE(),
[Measure] < 21, 1,
[Measure] < 51, 0.7,
[Measure] < 101, 0.5,
[Measure] < 201, 0.3,
0
)
Please mark all the responses that solved your issues as the solution.
Have I solved your problem? Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;). |
If you found this post helpful, please give Kudos. It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen. If you find my signature vaguely amusing, please give Kudos. | Proud to be a Super User! |
If I understand correctly, this measure should work.
(change [Measure] to whatever you've called it)
RankPictures =
SWITCH(
TRUE(),
[Measure] < 21, 1,
[Measure] < 51, 0.7,
[Measure] < 101, 0.5,
[Measure] < 201, 0.3,
0
)
Please mark all the responses that solved your issues as the solution.
Have I solved your problem? Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;). |
If you found this post helpful, please give Kudos. It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen. If you find my signature vaguely amusing, please give Kudos. | Proud to be a Super User! |