Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
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
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 9 | |
| 5 | |
| 4 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 23 | |
| 12 | |
| 11 | |
| 9 | |
| 8 |