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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

If in measure

I have a table where the columns are subgroup and limits. I made a measure that ranks output quantity by part number, this is from another table. I would like to compare that measure with the limits of the subgroup. If the rank is greater than the limit, it might be "Stock" otherwise "Discreet"
 
Thanks in advanced.
1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

Assume your tables are as below

Capture2.JPG

They have relationships as below

Capture1.JPG

Then create measures in Table1

Measure_rank =
RANKX (
    FILTER ( ALLSELECTED ( Table1 ), Table1[subgroup] = MAX ( Table1[subgroup] ) ),
    CALCULATE ( SUM ( Table1[quantity] ) ),
    ,
    DESC,
    DENSE
)
Measure_looklimits = LOOKUPVALUE(Table2[limits],Table2[subgroup],MAX(Table1[subgroup]))

Measure_S/T = IF([Measure_rank]>[Measure_looklimits],"Stock", "Discreet")

1.JPG

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

Assume your tables are as below

Capture2.JPG

They have relationships as below

Capture1.JPG

Then create measures in Table1

Measure_rank =
RANKX (
    FILTER ( ALLSELECTED ( Table1 ), Table1[subgroup] = MAX ( Table1[subgroup] ) ),
    CALCULATE ( SUM ( Table1[quantity] ) ),
    ,
    DESC,
    DENSE
)
Measure_looklimits = LOOKUPVALUE(Table2[limits],Table2[subgroup],MAX(Table1[subgroup]))

Measure_S/T = IF([Measure_rank]>[Measure_looklimits],"Stock", "Discreet")

1.JPG

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
Super User
Super User

The information you have provided is not making the problem clear to me. Can you please explain with an example. If possible please share a sample pbix file after removing sensitive information.
Thanks.

My Recent Blog -
https://community.powerbi.com/t5/Community-Blog/Winner-Topper-on-Map-How-to-Color-States-on-a-Map-wi...
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.