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
imranamikhan
Helper V
Helper V

Sum a measure for a different category

Hi everyone,

 

I have a problem which I hope has a straightforward solution.

 

I have a custom table with a column called Sub Theme and another column called Category.

 

I have a measure which:

  • sums the category values from the data source
  • divides that result by the number of duplicate categories in the same data source

Total by category =

    SUM ( REF_DIM_DB_Benefits_Unpivot[Score] ) / COUNT( ( REF_DIM_DB_Benefits_Unpivot[Mapping_table.Category] ))

 

example.PNG

 

I have now created a separate table visual from the same data source and displayed only the sub theme. How would I return the sum of the Total by category measure but grouped by sub theme? Essentially I am trying to calculate at a category level first, and then summing those values at sub theme level

 

For example, I would expect “01. Scale of Opportunity” to return 5, and “02. Service Quality” to return 25.

 

Best regards,

Ami

1 ACCEPTED SOLUTION
Vera_33
Resident Rockstar
Resident Rockstar

Hi @imranamikhan 

 

If I understand correctly, have a try

TEST = SUMX(VALUES(REF_DIM_DB_Benefits_Unpivot[Mapping_table.Category]),[Total by category])

View solution in original post

2 REPLIES 2
imranamikhan
Helper V
Helper V

Perfect thank you @Vera_33 

Vera_33
Resident Rockstar
Resident Rockstar

Hi @imranamikhan 

 

If I understand correctly, have a try

TEST = SUMX(VALUES(REF_DIM_DB_Benefits_Unpivot[Mapping_table.Category]),[Total by category])

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.