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
erihsehc
Helper III
Helper III

how to fix the measure value for further calculation

hi there,

I used the below dax to get the max absolute PAT% of the top 10 customer. When I use this measure for further calculation in a column, this max % changed for different customer. How to fix this max amount for further calculation? (this max % can be changed by slicers only, e.g. when selecting different year it should be updated, currently it works fine with slicer)

 

Max Abs value new = if(MAXX(SUMMARIZE(T_BO_APO_BGT_FY_ALL,T_BO_APO_BGT_FY_ALL[Customer_G],"rankingnew",[rankingnew],"PAT%",IF([rankingnew]<=10,ABS([Consol PAT%]),BLANK())),[PAT%])<0.08,0.12,MAXX(SUMMARIZE(T_BO_APO_BGT_FY_ALL,T_BO_APO_BGT_FY_ALL[Customer_G],"rankingnew",[rankingnew],"PAT%",IF([rankingnew]<=10,ABS([Consol PAT%]),BLANK())),[PAT%]))

 

when I put back this measure to the table, the % adjusted for different customer, I expect this is the max amount of the top ten should not be changed in the table

rank testing9.JPG

 

1 ACCEPTED SOLUTION
v-jiascu-msft
Employee
Employee

Hi @erihsehc,

 

You need function CALCULATE to change the context. Try this formula please. The point is calculate.

Max Abs value new =
VAR maxValue =
    CALCULATE (
        MAXX (
            SUMMARIZE (
                T_BO_APO_BGT_FY_ALL,
                T_BO_APO_BGT_FY_ALL[Customer_G],
                "rankingnew", [rankingnew],
                "PAT%", IF ( [rankingnew] <= 10, ABS ( [Consol PAT%] ), BLANK () )
            ),
            [PAT%]
        ),
        ALL ( T_BO_APO_BGT_FY_ALL )
    )
RETURN
    IF ( maxValue < 0.08, 0.12, maxValue )

Your date table could be independent.

If you want more help, please share your .pbix file. At least your model structure and the fields of the visual.

 

Best Regards!

Dale

Community Support Team _ Dale
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

3 REPLIES 3
v-jiascu-msft
Employee
Employee

Hi @erihsehc,

 

You need function CALCULATE to change the context. Try this formula please. The point is calculate.

Max Abs value new =
VAR maxValue =
    CALCULATE (
        MAXX (
            SUMMARIZE (
                T_BO_APO_BGT_FY_ALL,
                T_BO_APO_BGT_FY_ALL[Customer_G],
                "rankingnew", [rankingnew],
                "PAT%", IF ( [rankingnew] <= 10, ABS ( [Consol PAT%] ), BLANK () )
            ),
            [PAT%]
        ),
        ALL ( T_BO_APO_BGT_FY_ALL )
    )
RETURN
    IF ( maxValue < 0.08, 0.12, maxValue )

Your date table could be independent.

If you want more help, please share your .pbix file. At least your model structure and the fields of the visual.

 

Best Regards!

Dale

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

get the result, i changed the calculate(,all())to calculate(,allselected()), all fine now thanks @v-jiascu-msft

 

 

 

 

erihsehc
Helper III
Helper III

need help Man Indifferent

 

just like in Excel, we can exactly put formula equal a calculation result, how to do in power bi?

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.

Top Solution Authors
Top Kudoed Authors