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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors
Top Kudoed Authors