Forum Discussion
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 Trim | No. of Incidents per feeder_2 | Expected Value |
| 3 | 2.676861702 | |
| 4 | 3.133742331 | 17% |
| 5 | 3.180985109 | 19% |
| 6 | 3.46319797 | 29% |
| 7 | 3.791327913 | 42% |
| 8 | 3.739894552 | 40% |
| 9 | 4.010498688 | 50% |
| 10 | 4.139303483 | 55% |
How do you do this in DAX? Thanks
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- Anonymous5 years ago
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 ) - 1It 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
2 Replies
- ashamsuzzoha
Advocate II
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- AnonymousNot applicable
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 ) - 1It 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