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

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.

Reply
Anonymous
Not applicable

Sum some rows in matrix

Hello!!

I have this issue and Im not sure if is possible to do in pbi

 

I have a matrix like this

example matrix.JPG

 
 

I want to sum, only some of the categories, for example in this case, I only want to sum books and sport, and furniture only show the subcategory, with the data, but in the row of the furtinure that can appear blank.

Is possible to do that?

Thanks for the help

 

Monica

3 REPLIES 3
Anonymous
Not applicable

You can make use of the HASONEVALUE function to get what you're looking for, depending on how your data is set up.

The function takes a column name as its argument, you will want to use the column name that contains the subcategories. Your measure might look like this:

Measure = 
IF ( 
NOT(HASONEVALUE[table[subcategory])) && table[category] = "Furniture",
BLANK(),
CALCULATE ( 
SUM( table[value] ) ) 

 

Anonymous
Not applicable

@Anonymous, in a measure that does not have an iteration in it, you cannot compare a naked column to a value, so this measure of yours should error out. Also CALCULATE around SUM is not required. Moreover, this measure is syntactically incorrect.

Best
D

Anonymous
Not applicable

Thanks for the comment, is correct, I cant use this solution, im still looking for a solution for this.

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors