Forum Discussion
Anonymous
6 years agoNot applicable
Help with getting the latest value in a table for a certain tag
Hi
I'm new to Power BI and I'm been maing a mock data set in excel. I have made a dashboard which can already show only certain tags based on the room or system, but I want to make a radial gauge which shows the current, or most recent value of whatever is selected but I am struggling to find a way to pull the latest value. Any help would be appriciated!
Thanks
This is a sample of the table
| Room | Tag | Time | Value |
| Room 1 | Centrifuge 1 | 6/13/20 12:00 AM | 605 |
| Room 1 | Centrifuge 1 | 6/13/20 9:00 AM | 917 |
| Room 1 | Centrifuge 1 | 6/13/20 12:00 PM | 667 |
| Room 1 | Centrifuge 1 | 6/14/20 12:00 AM | 671 |
| Room 2 | BMS 4773 | 6/13/20 12:00 AM | 888 |
| Room 2 | BMS 4773 | 6/13/20 9:00 AM | 803 |
| Room 2 | BMS 4773 | 6/13/20 12:00 PM | 541 |
| Room 2 | BMS 4773 | 6/14/20 12:00 AM | 733 |
Hi Anonymous
Try this
Measure = VAR __lastDateTime = CALCULATE( MAX( 'Table'[International DateTime] ), ALL( 'Table' ), VALUES( 'Table'[Room] ), VALUES( 'Table'[Tag] ) ) RETURN CALCULATE( SUM( 'Table'[Value] ), KEEPFILTERS( 'Table'[International DateTime] = __lastDateTime ) )it will result in
Best Regards,
Mariusz
If this post helps, then please consider Accepting it as the solution.
Please feel free to connect with me.
LinkedIn
2 Replies
- Mariusz
Community Champion
Hi Anonymous
Try this
Measure = VAR __lastDateTime = CALCULATE( MAX( 'Table'[International DateTime] ), ALL( 'Table' ), VALUES( 'Table'[Room] ), VALUES( 'Table'[Tag] ) ) RETURN CALCULATE( SUM( 'Table'[Value] ), KEEPFILTERS( 'Table'[International DateTime] = __lastDateTime ) )it will result in
Best Regards,
Mariusz
If this post helps, then please consider Accepting it as the solution.
Please feel free to connect with me.
LinkedIn- AnonymousNot applicable
That worked flawlessly. Thanks for the help Mariusz !