Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.
Hello,
how do I write a measure to select the date alongside the latest/max value?
Based on below, I would like my measure to display as "07/02/2022" as 1.68 is the latest/max value.
date | index | value |
31/01/2022 | 0 | 0 |
07/02/2022 | 1 | 1.68 |
14/02/2022 | 2 | null |
21/02/2022 | 3 | null |
28/02/2022 | 4 | null |
07/03/2022 | 5 | null |
14/03/2022 | 6 | null |
21/03/2022 | 7 | null |
28/03/2022 | 8 | null |
04/04/2022 | 9 | null |
11/04/2022 | 10 | null |
18/04/2022 | 11 | null |
25/04/2022 | 12 | null |
02/05/2022 | 13 | null |
Thanks
A
Solved! Go to Solution.
Create a measure or column with this
var MaxValue = MAX( 'Table'[Column2] )
return
LOOKUPVALUE('Table'[Column1],'Table'[Column2],MaxValue)
Thanks @freginier though this doesn't work for me on table below. Do you know why?
var MaxValue = MAX( 'Table'[Column2] ) return LOOKUPVALUE('Table'[Column1],'Table'[Column2],MaxValue)
Column1 | Column2 |
31/01/2022 | 0 |
07/02/2022 | 1.68 |
14/02/2022 | null |
21/02/2022 | null |
28/02/2022 | null |
07/03/2022 | null |
14/03/2022 | null |
21/03/2022 | null |
28/03/2022 | null |
04/04/2022 | null |
11/04/2022 | null |
18/04/2022 | null |
25/04/2022 | null |
02/05/2022 | null |
Thanks @freginier though this doesn't work for me on table below. Do you know why?
var MaxValue = MAX( 'Table'[Column2] ) return LOOKUPVALUE('Table'[Column1],'Table'[Column2],MaxValue)
Column1 | Column2 |
31/01/2022 | 0 |
07/02/2022 | 1.68 |
14/02/2022 | null |
21/02/2022 | null |
28/02/2022 | null |
07/03/2022 | null |
14/03/2022 | null |
21/03/2022 | null |
28/03/2022 | null |
04/04/2022 | null |
11/04/2022 | null |
18/04/2022 | null |
25/04/2022 | null |
02/05/2022 | null |
Can you send me a power bi sample with this 2 columns ?
sorry, this did work. I neglected to name the measure when I copied your code
my measure = var MaxValue = MAX( 'Table'[Column2] ) return LOOKUPVALUE('Table'[Column1],'Table'[Column2],MaxValue)
Good. Enjoy 🙂
Don't forget to add kudo and accept the solution 😉
Create a measure or column with this
var MaxValue = MAX( 'Table'[Column2] )
return
LOOKUPVALUE('Table'[Column1],'Table'[Column2],MaxValue)
Check out the November 2023 Power BI update to learn about new features.
Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.