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 all,
First of all, what I'm trying to achieve will not be possible with a fill down method as all operations are being done to calculated columns. So I'd need a DAX calculated column to solve this issue.
I have the following table that contains an Index that defines a certain contact (we are looking at data for contact # 3 below), IndexDateRank, which orders the entries per contact by date, and Stage, that may or may not have a value for each entry. I want to be able to generate an Outcome column where it calculates what's the next non blank value, as seen below:
Index | IndexDateRank | Stage | Outcome |
3 | 1 | 6 | 3 |
3 | 2 | ||
3 | 3 | ||
3 | 4 | ||
3 | 5 | ||
3 | 6 | 3 | 1 |
3 | 7 | ||
3 | 8 | ||
3 | 9 | ||
3 | 10 | ||
3 | 11 | ||
3 | 12 | ||
3 | 13 | ||
3 | 14 | 1 | 1 |
3 | 15 | ||
3 | 16 | ||
3 | 17 | ||
3 | 18 | ||
3 | 19 | ||
3 | 20 | 1 | 5 |
3 | 21 | ||
3 | 22 | ||
3 | 23 | ||
3 | 24 | 5 | 5 |
3 | 25 |
Does anyone have a solution on how to generate the Outcome column?
Thanks in advance,
Antonio
Solved! Go to Solution.
Hi , @Anonymous
Try calculated column as below:
Column =
VAR index_ =
CALCULATE (
MIN ( [IndexDateRank] ),
FILTER (
'Table',
[IndexDateRank] > EARLIER ( [IndexDateRank] )
&& [Stage] <> BLANK ()
)
)
RETURN
IF (
[Stage] = BLANK (),
BLANK (),
CALCULATE (
MIN ( 'Table'[Stage] ),
FILTER ( 'Table', [IndexDateRank] = index_ )
)
)
The column result will show as below:
Please check attached pbix file for more details.
Best Regards,
Community Support Team _ Eason
Hi , @Anonymous
Try calculated column as below:
Column =
VAR index_ =
CALCULATE (
MIN ( [IndexDateRank] ),
FILTER (
'Table',
[IndexDateRank] > EARLIER ( [IndexDateRank] )
&& [Stage] <> BLANK ()
)
)
RETURN
IF (
[Stage] = BLANK (),
BLANK (),
CALCULATE (
MIN ( 'Table'[Stage] ),
FILTER ( 'Table', [IndexDateRank] = index_ )
)
)
The column result will show as below:
Please check attached pbix file for more details.
Best Regards,
Community Support Team _ Eason
Hi Eason,
Wow that's exactly it! You made it look so easy and elegant!
Thank you very much.
Best regards,
Antonio
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 |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |