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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors