Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello all,
I need help with a custom column or maybe a measure with the following logic:
Basically I have a table with categories and some values around them (Date column) where not all rows have data for that value column. You can think of category column as a hierarchy. What I want to achieve is to remove the rows that do not have any data but keep the parent nodes associated with the rows that have data.
The logic for OutcomeWanted (OW) column/measure:
| Category | Date | SortOrder | Depth | OutcomeWanted |
| Parent | 1 | 0 | 1 | |
| Child_1 | 2 | 1 | 1 | |
| Child_1_1 | 1/1/2020 | 3 | 2 | 1 |
| Child_1_2 | 4 | 2 | 0 | |
| Child_1_2_1 | 5 | 3 | 0 | |
| Child_2 | 6 | 1 | 1 | |
| Child_2_1 | 7 | 2 | 0 | |
| Child_2_2 | 8 | 2 | 0 | |
| Child_2_3 | 9 | 2 | 1 | |
| Child_2_3_1 | 10 | 3 | 0 | |
| Child_2_3_2 | 11 | 3 | 1 | |
| Child_2_3_2_1 | 2/2/2020 | 12 | 4 | 1 |
| Child_3 | 13 | 1 | 0 |
The idea is to filter out based on OW column by showing only values with 1. So my final table would look like this:
| Category | Date | SortOrder | Depth | OutcomeWanted |
| Parent | 1 | 0 | 1 | |
| Child_1 | 2 | 1 | 1 | |
| Child_1_1 | 1/1/2020 | 3 | 2 | 1 |
| Child_2 | 6 | 1 | 1 | |
| Child_2_3 | 9 | 2 | 1 | |
| Child_2_3_2 | 11 | 3 | 1 | |
| Child_2_3_2_1 | 2/2/2020 | 12 | 4 | 1 |
Thanks for looking.
Solved! Go to Solution.
Hi,
I am not sure if the below solution is the best way to approach, but please check the below picture and the attached pbix file. I tried to use PATH function and PATHITEM function to create the Outcome Wanted Calculated Column.
Hi,
I am not sure if the below solution is the best way to approach, but please check the below picture and the attached pbix file. I tried to use PATH function and PATHITEM function to create the Outcome Wanted Calculated Column.
Thank you very much, this works great!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 37 | |
| 37 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 130 | |
| 88 | |
| 82 | |
| 68 | |
| 64 |