Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
astahir85
Regular Visitor

Need help with RANKX and assigning variables based on min max dynamically

Hi power users,

 

I have a set of data that I need some help with. Here is my case. I have a table as such

 

Part Number - Revenue - Margin - Qty

0100 - $55 - 30% - 2

0200 - $600 - 20% - 10

0300 - $25 - 70% - 5

0400 - $679 - 80% - 60

0500 - $750 - 10% - 100

 

I'd like to create a dynamic measure that help me assign a variable to anything over $50 revenue as A, anything between $25 - $50 as B and below $25 as C. The issue is, I need it to be dynamic because this table with the same part numbers maybe different for different stores. i.e. 0100 maybe $30 with 25% and 100 qty. in that case, 0100 should be B and A - based on how I filter the visual/page.

 

Can someone please help me with this?

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

Screenshot 2019-08-29 22.06.02.png

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

10 REPLIES 10
amitchandak
Super User
Super User

Screenshot 2019-08-29 22.06.02.png

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks Amit, I feel like such a noob

Thanks Amit, one more question. How can I look at a donut chart to see what percentage is A, B or C in terms of percentage. I can't drag A/B/C measure to values/legend, can only add it to tooltips. Hence I can't see what percentage was A or B or C

Under format option -> Detail labels -> label Style

Screenshot 2019-08-30 00.01.26.png

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi Amit

 

I am adding 'Part number' in legend, 'Revenue' in Values and 'ABC' in Tooltips (can't move it anywhere else). This is not allowing me to see what you have. 

Hi Amit

 

Any idea how I can distinct count this measure?

Drag a field on the graph under Value. The down angle or right-click will give you count distinct options. This only for columns not for measures.

Screenshot 2019-09-03 21.15.17.png

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

So I am using this formula

AAA Qty =IF([Total Qty]>100, "A", IF([Total Qty]>50, "B", "C"))
 
and when I drag this measure to the page it goes under toolstips rather than axis
 
 
image.png

Are you not able to drag it into the axis box ?

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

No, it doesn't allow me. Doesn't flag me either, but any other table I can move it just not this measure

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.