Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
elabaigt
Frequent Visitor

Visualize last value of a gauge

Hello everyone,

 

I already seen before this question but I never had and answer about it.

So there is my problem I have some data that I want to display in a gauge but when I do it the gauge show to me the sum or the max of the data. I don't know how to get the last value in my table.

I tried to correct this problem by adding a filter with top N and by the value the latest date but when I do that I have the lastest value but the max value isn't right I just getting the double of the value

gauge.PNG

Parameters.PNG

 

Can you help me please?

 

Thank you in advance!

1 ACCEPTED SOLUTION

Apologies. This is what I get just typing formulas into the forum instead of checking the syntax.  Wrapping it in a FILTER should fix that issue:

 

LatestValue = CALCULATE( SELECTEDVALUE(Table1[Value]), FILTER(Table1, Table1[Date] = MAX(Table1[Date])) )

View solution in original post

5 REPLIES 5
Cmcmahan
Resident Rockstar
Resident Rockstar

What do you want the max value of the gauge to be?  PowerBI assumes double the current amount if no value is given.

Thank you for your reply,

 

I want the latest value in my table which is display on the enter of the gauge and I want also the max value display and not the double of my latest value

See below the position:

gauge.PNG

Ahh, looks like you need to create your own measure here.

 

First thing I would do would be to remove your visual level filter that's only pulling the Top 1 value by latest date.  Then set the max of your gauge to the max of Value.

 

Then to get today's value for the position of the gauge, we create a measure like so:

LatestValue = CALCULATE( SELECTEDVALUE(Table1[Value]), Table1[Date] = MAX(Table1[Date]) )

Drop that into your visualization bucket and you're good to go. 

tHANKS FOR YOUR REPLY?

 

I have an error when I copy paste your function I replace the nam of the table but when I replace Table1[Date] Powr BI say that the function MAX is used in a true/false expression and can't be used for the table filter

Apologies. This is what I get just typing formulas into the forum instead of checking the syntax.  Wrapping it in a FILTER should fix that issue:

 

LatestValue = CALCULATE( SELECTEDVALUE(Table1[Value]), FILTER(Table1, Table1[Date] = MAX(Table1[Date])) )

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors