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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
AKHIL_RB_123
Frequent Visitor

Unable to find sum of different categories in same dimension

Greetings all,

 

I'm new to Power BI/Dax in general so apologize if this might seems obvious but I couldn't manage to find a way to do it.

 

I basically have a dimension category here I need to sum AA & BB then CC & DD. And create a final table B

 

TABLE A: DETAILS
 CategoryValue 
AA10 
BB20 
CC30 
DD40 

 

 

TABLE B: EXPECTED OUTCOME
 CategoryValueOutput
AA1030
BB2030
CC3070
DD4070

 

 

1 REPLY 1
amitchandak
Super User
Super User

@AKHIL_RB_123 , First Create a new column

 

Cat =

Switch(True() ,

[Category] in {"AA", "BB"} , "Cat1" ,

"Cat2")

 

 

Now a new measure

sumx(filter(Table, [Cat]=earlier([Cat]), Table[Value])

 

or

 

sumx(allselected(Table), [Cat] = Max([Cat]) ), [Value])

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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