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.
hello, I am looking to calculate the difference between the preview row in a matrix table.
I can do this in Excel, but not sure where to start with DAX.
Solved! Go to Solution.
Thank you @VahidDM for your prompt reply.
Hi @NewbieJono ,
Depending on the information you have provided, you can add a new measure:
NEW Difference =
VAR _Totalswtiches =
SELECTEDVALUE ( 'Table'[Total_switches] )
VAR _MOVEAVERAGE =
MAXX (
FILTER ( ALL ( 'Table' ), [Total_switches] < _Totalswtiches ),
[NEW Average]
)
RETURN
IF ( _Totalswtiches = 0, 0, SUM ( 'Table'[NEW Average] ) - _MOVEAVERAGE )
Final output:
How to Get Your Question Answered Quickly - Microsoft Fabric Community
If it does not help, please provide more details with your desired out put and pbix file without privacy information.
Best Regards,
Ada Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you @VahidDM for your prompt reply.
Hi @NewbieJono ,
Depending on the information you have provided, you can add a new measure:
NEW Difference =
VAR _Totalswtiches =
SELECTEDVALUE ( 'Table'[Total_switches] )
VAR _MOVEAVERAGE =
MAXX (
FILTER ( ALL ( 'Table' ), [Total_switches] < _Totalswtiches ),
[NEW Average]
)
RETURN
IF ( _Totalswtiches = 0, 0, SUM ( 'Table'[NEW Average] ) - _MOVEAVERAGE )
Final output:
How to Get Your Question Answered Quickly - Microsoft Fabric Community
If it does not help, please provide more details with your desired out put and pbix file without privacy information.
Best Regards,
Ada Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @NewbieJono
Create a measure using this DAX Expression:
Difference =
VAR _L =
CALCULATE (
SUM ( 'Table'[Calendar Days] ),
'Table'[Col Numbe]
= ( MAX ( 'Table'[Col Numbe] ) - 1 )
)
RETURN
SUM ( 'Table'[Calendar Days] ) - _L
Output:
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Thank you, is there any method to stop day zero and the last zero showing incorrect. day zero difference should be 0. last day not calculating correct
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
105 | |
105 | |
88 | |
73 | |
66 |
User | Count |
---|---|
122 | |
112 | |
98 | |
79 | |
72 |