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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
efjw
Helper I
Helper I

Displaying latest value on gauge visual (via DirectQuery)

Hi! I am trying to display the latest value of actualtotalbuildingwaterflow on my gauge visual. I created a new measure currentTBWF to get the latest value of actualtotalbuildingwaterflow but it returns blank. Is my dax equation wrong? Also, is the only way for me to display the latest value by using a measure? When I add actualtotalbuildingwaterflow as the Value in the gauge visual, it sums up all the values. Thanks 🙂

 

currentTBWF =
VAR LatestDatetime = MAX('changi demotagdata11'[datetime])
VAR LatestWaterFlow =
    CALCULATE(
        MAX('changi demotagdata11'[actualtotalbuildingwaterflow]),
        FILTER(
            ALL('changi demotagdata11'),
            'changi demotagdata11'[datetime] = LatestDatetime
        )
    )
RETURN
LatestWaterFlow


1 ACCEPTED SOLUTION
efjw
Helper I
Helper I

@bhanu_gautam Unfortunately that still returned as blank for me but I tried 

currentTBWF = MAX('demotagdata11'[actualtotalbuildingwaterflow]) and it works now! Thanks for your help 🙂

View solution in original post

2 REPLIES 2
efjw
Helper I
Helper I

@bhanu_gautam Unfortunately that still returned as blank for me but I tried 

currentTBWF = MAX('demotagdata11'[actualtotalbuildingwaterflow]) and it works now! Thanks for your help 🙂
bhanu_gautam
Super User
Super User

@efjw , Try updaing measure as

 

currentTBWF =
CALCULATE(
LASTNONBLANK('changi demotagdata11'[actualtotalbuildingwaterflow], 'changi demotagdata11'[datetime]),
FILTER(
ALL('changi demotagdata11'),
'changi demotagdata11'[datetime] = LASTDATE('changi demotagdata11'[datetime])
)
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.