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
Anonymous
Not applicable

Issues with Creating a Cohort Group (using a calculated column)

Hello Community  -  I have created the following calculated column.    In general, this works fine however:   If I have a table with the Opportunity Name (and not the opportunity id) you will see below that I get values that do not match the switch conditions.  

 

This is because there are duplicate Opportunity Names, each with their own "tech amount converted" value  (this is the opp value).   These are actually unique opportunities, as evidenced by the unique opportunity IDs in the other example...and when this field is added, the cohort formula works perfectly.  

 

So my question is:   Can I modify this calculated column so that it works without needing to have the opportunity ID in the table?  Or do I perhaps need to concatenate the Opportunity Name and the ID and somehow have the calculated column use that?   Any guidance or advice is appreciated!

 

Tech Amount Converted Cohorts =
SWITCH(
TRUE(),
[Sum of Tech Amount Converted] < 10000, "$0 to 10k",
[Sum of Tech Amount Converted] < 20000, "$10k to 20k",
[Sum of Tech Amount Converted] < 30000, "$20k to 30k",
[Sum of Tech Amount Converted] < 40000, "$30k to 40k",
[Sum of Tech Amount Converted] < 50000, "$40k to 50k",
[Sum of Tech Amount Converted] < 100000, "$50k to 100k",
[Sum of Tech Amount Converted] < 500000, "$100k to 500k",
[Sum of Tech Amount Converted] >= 500000, "$500k +",
BLANK()
)

 

texmexdragon2_0-1680913795022.png  

 

 

texmexdragon2_1-1680913922191.png

 

 

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , when you have measure, you need to dynamic segment

 

Dynamic Segmentation Bucketing Binning
https://community.powerbi.com/t5/Quick-Measures-Gallery/Dynamic-Segmentation-Bucketing-Binning/m-p/1387187#M626


Dynamic Segmentation, Bucketing or Binning: https://youtu.be/CuczXPj0N-k

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
Anonymous
Not applicable

@I recreated based on your information above, but still get the exact same issue:   The data is correct if I have the Opportunity ID in the table...but it is not correct if I only have the Opportunity name. 

 

It seems in your example data (which I'm not able to see in the query editor), you may have concatenated the customer name and customer id.    This is what I think I have to do as well, for Opp name and Opp ID.  Is that correct?

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors