Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
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
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
14 | |
10 | |
10 | |
9 | |
9 |
User | Count |
---|---|
20 | |
13 | |
12 | |
11 | |
8 |