Forum Discussion

efjw's avatar
efjw
Icon for Helper I rankHelper I
2 years ago
Solved

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


  • 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 🙂

2 Replies

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

  • 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 🙂