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.
Hello,
I have a table that contains father_code and for each one of them there is a son code(it's like category and subcategory).
In parallel with, i have a corresponding label that corresponds to heach category. (It's like having Cateogry and subcategory and with it color and subcolor).
Note: The son code here is the first element as there is no father code for it.
Here is my table:
Son_code | Father_code | Label |
A | 1 | |
B | A | 3 |
H | A | 2 |
E | A | 4 |
F | A | 5 |
C | B | 6 |
D | B | 7 |
I tried using matrix to visualize the data but it does not work with double hiearchies as the first son code is not the real son code but the father code.
Here is a formatted table to understand the problem and how the output should show:
CODE | LABEL | |
+ | A | 1 |
- | A|H | 1|2 |
- | A|B | 1|3 |
- | A|F | 1|5 |
- | A|E | 1|4 |
- | A|B|C | 1 | 3 | 6 |
- | A|B|D | 1|3 | 7 |
If you have any idea on that either matrix or using DAX to format that.
Thank you in advance,
Salem
Solved! Go to Solution.
Hey salemhaddad,
Look into the PATH DAX function. Here's a link to some documentation. It seems to be exactly what you need.
----------------------------------
If this post helps, please consider accepting it as the solution to help other members find it quickly. Also, don't forget to hit that thumbs up and subscribe! (Oh, uh, wrong platform?)
P.S. Need a more in-depth consultation for your Power BI data modeling or DAX issues? Feel free to hire me on Upwork or DM me directly on here! I would love to clear up your Power BI headaches.
It works by putting it as column and not a measure.
Thank you very much.
It works by putting it as column and not a measure.
Thank you very much.
You're welcome!
Thank you very much for the recommandation.
I tried to use it:
Hey salemhaddad,
Look into the PATH DAX function. Here's a link to some documentation. It seems to be exactly what you need.
----------------------------------
If this post helps, please consider accepting it as the solution to help other members find it quickly. Also, don't forget to hit that thumbs up and subscribe! (Oh, uh, wrong platform?)
P.S. Need a more in-depth consultation for your Power BI data modeling or DAX issues? Feel free to hire me on Upwork or DM me directly on here! I would love to clear up your Power BI headaches.
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 |
---|---|
103 | |
101 | |
87 | |
73 | |
67 |
User | Count |
---|---|
116 | |
109 | |
94 | |
79 | |
72 |