Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

How can I dynamically ignore parent if it's repeated in child (in Matrix)

Hello,

I hope you can help me since I'm still learning.

I have a Matrix with multiple rows. They all come as columns from the same table.

On the third level sometimes I have items starting with the same word (ex contoso 1, contoso 2, contoso 3) and I would like to create a parent level to group them in (example contoso, where then you can expand and find all 3 items).

If I create another column with the common word (contoso), other items which have no "similars" will just be repeated between parent and child.

 

Is there a way to create a fictitious level? 

 

Thank you,

I hope I was clear

3 REPLIES 3
danextian
Super User
Super User

Hi @Anonymous ,

 

This can be done by adding a  parent-level column in Power Query or in DAX. The logic though will  depend on the contents of the original column and this could be a trial and error or one that needs to be updated regularly. Possible logics:

  • If the parent name is before a specific character/s, extract the words before those character/s.
  • If it starts with the word contoso, then contoso. If it starts with xyz,  then xyz so on and so forth.




Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
Anonymous
Not applicable

Hi, thank you for your reply.

I did get as far as creating a new column with only the first word, but then I'm not able to figure out a way to exclude the repeated ones from the hierarchy.

What i mean is, it creates an entry contoso, which includes contoso 1, contoso 2, contoso 3, but then there's also singular entries like  "Microsoft" which would just be repeated in hierarchy. So expanding Microsoft you would find Microsoft again.

I know it's not a huge problem, but it doesn't look very professional, especially because the singular entries are more than the similar ones, so it would happen often.

Is there a way to make the entries on level 4 jump to level 3 if they are the same?

Or if I use logic to leave level 3 blank instead of repeating it, is there a way to pass level 4 on to level 3?

Hi,

 

Can you please post a sample data that can be copy-pasted and the result you want to achieve. It is easier to figure out the logic or if it is doable in Power BI without so much work.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.