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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
red_arrowhead
Helper I
Helper I

How to create a sum measure with specific conditions

I have data divided into calander weeks. I have a few identifiers and their values divided into columns of calender weeks which are  created from dates and relationships with calender weeks. 

Now I want to have a visual with can showthe sum of first 5 identifiers together into all calender weeks and another row with sum of last 2 identifiers together into all calender weeks. 

How can I do it?

Example 

red_arrowhead_0-1612344947707.png

Here I want sum of all values of A,B,C,D together in those seperate CW

and sum of E,F into another row seperated into CW

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@red_arrowhead , Not very clear. You have to create a new column like this and use that

 


Switch(True(),
[identifier] in {"A","B","C", "D"} , "Cat1",
[identifier] in {"E", "F"},"Cat2"
)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@red_arrowhead , Not very clear. You have to create a new column like this and use that

 


Switch(True(),
[identifier] in {"A","B","C", "D"} , "Cat1",
[identifier] in {"E", "F"},"Cat2"
)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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