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

Percentage change from a fixed point

I have the following data. [No. of Incidents per feeder_2] is a calculated measure, and TableName[Years Since Last Trim] is a dim table column. I want another measure that calculates the percentage change from [Years Since Last Trim] = 3

 

Years Since Last TrimNo. of Incidents per feeder_2Expected Value
32.676861702 
43.13374233117%
53.18098510919%
63.4631979729%
73.79132791342%
83.73989455240%
94.01049868850%
104.13930348355%

 

How do you do this in DAX? Thanks

2 ACCEPTED SOLUTIONS
ashamsuzzoha
Helper III
Helper III

Never mind, I figured out. I thought it was going to be more complicated than using calculate().

 

#_Pct change since Yr 3 = 

DIVIDE(
    [No. of Incidents per feeder_2], 
    CALCULATE([No. of Incidents per feeder_2], 'Years Since Last Exposure'[Years Since Last Trim] = 3)
) - 1

View solution in original post

Hi @ashamsuzzoha ,

You can create a measure as below:

#_Pct change since Yr 3 = 
VAR _curfeeder =
    MAX ( 'Years Since Last Exposure'[No. of Incidents per feeder_2] )
VAR _3feeder =
    CALCULATE (
        MAX ( 'Years Since Last Exposure'[No. of Incidents per feeder_2] ),
        FILTER (
            ALLSELECTED ( 'Years Since Last Exposure' ),
            'Years Since Last Exposure'[Years Since Last Trim] = 3
        )
    )
RETURN
    DIVIDE ( _curfeeder, _3feeder ) - 1​

Percentage change from a fixed point.JPG

It seems you have already resolve it by yourself, the above one is for reference only. Could you please mark this thread as Answered? Thank you.

Best Regards

Rena

 

 

 

Community Support Team _ Rena
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
ashamsuzzoha
Helper III
Helper III

Never mind, I figured out. I thought it was going to be more complicated than using calculate().

 

#_Pct change since Yr 3 = 

DIVIDE(
    [No. of Incidents per feeder_2], 
    CALCULATE([No. of Incidents per feeder_2], 'Years Since Last Exposure'[Years Since Last Trim] = 3)
) - 1

Hi @ashamsuzzoha ,

You can create a measure as below:

#_Pct change since Yr 3 = 
VAR _curfeeder =
    MAX ( 'Years Since Last Exposure'[No. of Incidents per feeder_2] )
VAR _3feeder =
    CALCULATE (
        MAX ( 'Years Since Last Exposure'[No. of Incidents per feeder_2] ),
        FILTER (
            ALLSELECTED ( 'Years Since Last Exposure' ),
            'Years Since Last Exposure'[Years Since Last Trim] = 3
        )
    )
RETURN
    DIVIDE ( _curfeeder, _3feeder ) - 1​

Percentage change from a fixed point.JPG

It seems you have already resolve it by yourself, the above one is for reference only. Could you please mark this thread as Answered? Thank you.

Best Regards

Rena

 

 

 

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

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.