Forum Discussion
Percentage price variation between two dates
Dear all!
I want to calculate percetage price variation between two dates.
Is possible to make a box to introduce Start Date and End Date?
I add the pbix Fuel stimation
- Anonymous2 years ago
Hi godtooro ,
You can create a measure as follows.
Variance = var _value=CALCULATE(SUM('Table'[Diesel]),FILTER(ALLSELECTED('Table'),[Date]>MAX('Table'[Date]))) return ABS(DIVIDE(SUM('Table'[Diesel])-_value,_value))If you want all rows return the result, you can create a new measure.
Measure = SUMX(ALLSELECTED('Table'),[Variance])You can check more details by downloading the attachment.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
3 Replies
- godtooroHelper II
- AnonymousNot applicable
Hi godtooro ,
You can create a measure as follows.
Variance = var _value=CALCULATE(SUM('Table'[Diesel]),FILTER(ALLSELECTED('Table'),[Date]>MAX('Table'[Date]))) return ABS(DIVIDE(SUM('Table'[Diesel])-_value,_value))If you want all rows return the result, you can create a new measure.
Measure = SUMX(ALLSELECTED('Table'),[Variance])You can check more details by downloading the attachment.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.