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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Quinnie2017
Helper II
Helper II

Group values of a column into two groups

You would think by now I would know how to do this but alas I have struck out.  Can you help?

 

Trying to group the values in column "Popeyes" into two groups: >0 and 0.

 

Expected values for Count of Stores

>0 = 247

0 = 739

 

Popeyes file here 

 

What is the DAX to do this?

 

 

1 ACCEPTED SOLUTION
TheoC
Super User
Super User

Hi @Quinnie2017 

 

You can create a calculated column as follows:

 

Column = SWITCH ( TRUE () , 'Table'[Popeyes] = 0 , 739, 247 )

 

Basically, the formula says, if Popeyes column = 0 then return 739, otherwise, return 247 for everything else.

 

Also, make sure that you have Popeyes column set to Whole Number and not Text.

 

Hope this helps 🙂

Theo

 

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

View solution in original post

2 REPLIES 2
Quinnie2017
Helper II
Helper II

@TheoCThank you!

TheoC
Super User
Super User

Hi @Quinnie2017 

 

You can create a calculated column as follows:

 

Column = SWITCH ( TRUE () , 'Table'[Popeyes] = 0 , 739, 247 )

 

Basically, the formula says, if Popeyes column = 0 then return 739, otherwise, return 247 for everything else.

 

Also, make sure that you have Popeyes column set to Whole Number and not Text.

 

Hope this helps 🙂

Theo

 

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors