- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Use the Last Value in a Matrix as the "Total"
We calculate and report OSHA TRIR monthly in a Matrix that has the "goal", "results" and "delta".
The challange is to have the last or latest value as the "Total"
I use the current formula which is part of a Switch with about 60 metrics:
Results = (if(HASONEVALUE(T_Metric_Input_History[Metric]) |
,switch(values('T_Metric_Input_History'[Metric]) |
,"OSHA TRIR",format(average(T_Metric_Input_History[Results]),"0.00") |
Any help would be greatly appreciated!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

@PaulBethancourt , use a measure like on top of you measure
if(not isinscope(Date[year Month]),calculate(lastnonblankvalue(Date[year Month], [Measure]),allselected(Date[year Month])),[Measure])
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

I have the following table with a DAX that calculates the variation versus the previous month and I want the total to be equal to the last month with data (marked in yellow) could you help me how to modify the DAX please
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

@PaulBethancourt , use a measure like on top of you measure
if(not isinscope(Date[year Month]),calculate(lastnonblankvalue(Date[year Month], [Measure]),allselected(Date[year Month])),[Measure])
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

amitchandak, you are a rock star!
Thank you very much!
I made a minor change in order to use the Result column since it wasn't a measure.
I used an average of it.
,"OSHA TRIR",format(if(not isinscope('Date table'[YRMO]),calculate(lastnonblankvalue('Date table'[YRMO],average(T_Metric_Input_History[Results])),allselected('Date table'[YRMO])),average('T_Metric_Input_History'[Results])),"0.00") |

Helpful resources
Subject | Author | Posted | |
---|---|---|---|
09-14-2023 01:19 PM | |||
02-25-2022 06:32 AM | |||
09-19-2024 10:49 PM | |||
08-29-2024 04:52 PM | |||
09-11-2023 11:18 AM |
User | Count |
---|---|
138 | |
107 | |
84 | |
60 | |
46 |