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 everyone,
I have the following table:
Indicator | Date | Value1 | Value2 |
x | 01/01/2022 | 1 | 2 |
x | 01/02/2022 | 2 | 3 |
x | 01/03/2022 | 4 | 5 |
x | 01/04/2022 | 6 | |
y | 01/01/2022 | 7 | 8 |
y | 01/02/2022 | 9 | 10 |
y | 01/03/2022 | 11 | 12 |
y | 01/04/2022 | 13 |
I would like to extract from this table the last available non blank value for Value2 for value 'x' as Indicator. In this situation that means I want to extract '5' as this is the last available value in time for indicator x and in column Value2. I tried with LASTNONBLANKVALUE but cannot figure it out. Can anyone help me?
Solved! Go to Solution.
Try this..
Measure =
var maxdate = CALCULATE(MAX('Table'[Date]),'Table'[Indicator] = "x", NOT ISBLANK('Table'[Value2]))
return CALCULATE(MAX('Table'[Value2]),'Table'[Date]=maxdate,'Table'[Indicator] = "x")
Hi:
If you want a more simple measure using LASTNONBLANK, you can use:
Hi:
I did this by first putting a calc column in the table (I called table "Data")
Then I followed with a measure. * I have a Date Table Attached.
Calc Col:
I hope this helps!
@Anonymous
Value1 and Value2 are measures or columns? How are going to disply thhe result?
Value1 and Value2 are calculated columns of the table. I want to have conditional markup based on the requested value, so I need it returned as a singular value.
Try this..
Measure =
var maxdate = CALCULATE(MAX('Table'[Date]),'Table'[Indicator] = "x", NOT ISBLANK('Table'[Value2]))
return CALCULATE(MAX('Table'[Value2]),'Table'[Date]=maxdate,'Table'[Indicator] = "x")
thank you
very helpful
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 |
---|---|
38 | |
26 | |
20 | |
15 | |
8 |
User | Count |
---|---|
69 | |
47 | |
46 | |
20 | |
16 |