cancel
Showing results for 
Search instead for 
Did you mean: 

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

Reply
PaulBethancourt
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"

PaulBethancourt_0-1675962554263.png

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
amitchandak
Super User
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])

View solution in original post

2 REPLIES 2
amitchandak
Super User
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])

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

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

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

Community News

Fabric Community News unified experience

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

Power BI Fabric Summit Carousel

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