cancel
Showing results for
Did you mean:

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Frequent Visitor

## 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!

1 ACCEPTED SOLUTION
Super User

@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])

2 REPLIES 2
Super User

@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])

Frequent Visitor

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")

Announcements

#### Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

#### Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

#### The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors