Forum Discussion
Volume Calculation
- 5 years ago
Hi Anonymous ,
You may create a measure like DAX below to get diff value per month. While it won't achieve your requirement for the layout of Matrix visual completely, you may try to put [Equipment]and [MeterName] into Rows box of Matrix, put [Category] into Columns box, put [Month] and [Diff Value per month] into Values box.
Diff Value per month = VAR _PreMonth = CALCULATE ( SUM ( Table1[MeterValue] ), FILTER ( ALLEXCEPT ( Table1, [Category], [Equipment], [MeterName] ), YEAR ( Table1[Date] ) = YEAR ( MAX ( Table1[Date] ) ) && MONTH ( Table1[Date] ) = MONTH ( MAX ( Table1[Date] ) ) - 1 ) ) VAR _CurMonth = CALCULATE ( SUM ( Table1[MeterValue] ), FILTER ( ALLEXCEPT ( Table1, [Category], [Equipment], [MeterName] ), YEAR ( Table1[Date] ) = YEAR ( MAX ( Table1[Date] ) ) && MONTH ( Table1[Date] ) = MONTH ( MAX ( Table1[Date] ) ) ) ) RETURN _CurMonth - _PreMonthBest Regards,
Amy
Community Support Team _ Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous ,
You may create a measure like DAX below to get diff value per month. While it won't achieve your requirement for the layout of Matrix visual completely, you may try to put [Equipment]and [MeterName] into Rows box of Matrix, put [Category] into Columns box, put [Month] and [Diff Value per month] into Values box.
Diff Value per month =
VAR _PreMonth =
CALCULATE (
SUM ( Table1[MeterValue] ),
FILTER (
ALLEXCEPT ( Table1, [Category], [Equipment], [MeterName] ),
YEAR ( Table1[Date] ) = YEAR ( MAX ( Table1[Date] ) )
&& MONTH ( Table1[Date] )
= MONTH ( MAX ( Table1[Date] ) ) - 1
)
)
VAR _CurMonth =
CALCULATE (
SUM ( Table1[MeterValue] ),
FILTER (
ALLEXCEPT ( Table1, [Category], [Equipment], [MeterName] ),
YEAR ( Table1[Date] ) = YEAR ( MAX ( Table1[Date] ) )
&& MONTH ( Table1[Date] ) = MONTH ( MAX ( Table1[Date] ) )
)
)
RETURN
_CurMonth - _PreMonth
Best Regards,
Amy
Community Support Team _ Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Team,
I tried it but still it didn't work, I really don't know why? 😠I am just 2 weeks in the learning process of PBI, so please have a forbearance on me 😢. Can anyone guide me on how to do it, I am begging please? Thanks.
Regards,
Jhay
- v-xicai5 years agoCommunity Support
Hi Anonymous ,
It is impossible to achieve the layout completely as you showed in original Post above, so you may try the method which I have suggested, create the measure, then put related fields into Rows , Columns and Values box of Matrix visual.
Best Regards,
Amy
Community Support Team _ Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.