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.
Hi all,
I have a set of values and I would like to select only the latest value based on the timestamp created.
The latest value can go as deep as 0.01 seconds of difference.
And also when I want to show the value in gauge, there is no option for me to show the latest value of generation only. Instead there are only options for sum, average and etc.
Solved! Go to Solution.
Hi @Anonymous ,
You can use following calculate column formula to mark last date for each id:
Is Last = VAR currID = Table[ID] VAR _lastdate = CALCULATE ( MAX ( Table[CreateTimestamp] ), FILTER ( ALL ( Table ), [ID] = EARLIER ( Table[ID] ) ) ) RETURN IF ( [CreateTimestamp] = _lastdate && [ID] = currID, "Y" )
For gauge chart, you can add a filter on visual level to display matched records.
Regards,
Xiaoxin Sheng
Hi @Anonymous ,
Please add index column to your table, then you can use current datetime and index fields to find out last records.
Measure = VAR currDT = MAX ( Table[CreatedTimestamp] ) VAR _lastId = CALCULATE ( MAX ( Table[Index] ), FILTER ( ALLSELECTED ( Table ), [CreatedTimestamp] = currDT ) ) RETURN CALCULATE ( MAX ( Table[Generation] ), FILTER ( ALLSELECTED ( Table ), [CreatedTimestamp] = currDT && [Index] = _lastId ) )
Regards,
Xiaoxin Sheng
I have a list of IDs and I want to show the latest value for every ID, how can I do it?
Appreciate your help, thanks. @v-shex-msft
And I want to show every latest value in gauge chart as seen below:
Hi @Anonymous ,
You can use following calculate column formula to mark last date for each id:
Is Last = VAR currID = Table[ID] VAR _lastdate = CALCULATE ( MAX ( Table[CreateTimestamp] ), FILTER ( ALL ( Table ), [ID] = EARLIER ( Table[ID] ) ) ) RETURN IF ( [CreateTimestamp] = _lastdate && [ID] = currID, "Y" )
For gauge chart, you can add a filter on visual level to display matched records.
Regards,
Xiaoxin Sheng
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
115 | |
100 | |
88 | |
70 | |
61 |
User | Count |
---|---|
151 | |
120 | |
103 | |
87 | |
68 |