Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
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
User | Count |
---|---|
42 | |
28 | |
24 | |
20 | |
16 |
User | Count |
---|---|
54 | |
35 | |
18 | |
18 | |
15 |