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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
hruv01
Frequent Visitor

For hierarchy LEVEL1 and LEVEL2, leave specific/defined items blank instead of using subtotals

Hi, I have a CSV file containing a hierarchy for a matrix table in Power BI. The hierarchy is structured in such a way that the first column represents the first level of the hierarchy, the second column represents the second level, and so on up to the fifth level, which corresponds to the fifth column. This hierarchy is linked to a data table through a key, where the numerical values are obtained. The matrix table assigns values to the lowest level of the hierarchy, while higher levels simply aggregate the values of the lower levels. What I need is for the first level of the hierarchy, called "Total," to not aggregate values but remain blank. How can I specify this particular level without DAX returning blank values on lower levels? I'm familiar with the special button for removing subtotal rows, but that doesn't solve my problem when I also need to define specific items from level 2 too.
Thank youu

1 REPLY 1
Sahir_Maharaj
Super User
Super User

Hello @hruv01,

 

To achieve your desired result, you can use a combination of DAX functions and settings within the matrix visual.

 

  1. Create a relationship between the two tables using the appropriate key column.
  2. Add a matrix visual to your report canvas.
  3. Place the hierarchy columns in the rows section of the matrix, from the highest level to the lowest level (e.g., Level 1 in the first column, Level 2 in the second column, etc.).
  4. Place the numerical values column from the data table in the values section of the matrix.
  5. Use this following DAX formula to define a measure that calculates the values for each level but keeps the "Total" level blank.
MyMeasure =
IF (
    ISFILTERED ( 'HierarchyTable'[Level1Column] ),
    BLANK (),
    SUM ( 'DataTable'[NumericValue] )
)

 

Note: Go back to the matrix visual and replace the existing numerical values column with the newly created measure. To remove the subtotals for the first level of the hierarchy, select the matrix visual, go to the "Format" tab, expand the "Subtotals" section, and disable the "Row subtotals" option.

 

Should you require further details or assistance please do not hesitate to reach out to me.


Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution? (Yes, its FREE!)
➤ Lets connect on LinkedIn: Join my network of 15K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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