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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Beginner question : Count when several data in a row

Hello, I'm currently stuck in my small project and I have a question:

I currently have those data:

FR

BEL

FR/ES

SP

GER

FR/BEL/GER

 

And I would love to make a table with all the countries on the left and the count for each on the right. I basically tried the "Count function" but it doesn't work when there is several counties on the same row.

Is it possible to do it?

 

Thank you!!

1 ACCEPTED SOLUTION
Samarth_18
Community Champion
Community Champion

Hi @Anonymous ,

 

Please follow below steps to achive this:-

1.Split your column like below:-

image.png

output:-

Samarth_18_0-1647257002079.png

 

 

2. Now use Group By with countries

Samarth_18_1-1647257124559.png

3. Now click on Close and apply.

Final Output:-

Samarth_18_2-1647257167643.png

 

Thanks,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

View solution in original post

4 REPLIES 4
Samarth_18
Community Champion
Community Champion

Hi @Anonymous ,

 

Please follow below steps to achive this:-

1.Split your column like below:-

image.png

output:-

Samarth_18_0-1647257002079.png

 

 

2. Now use Group By with countries

Samarth_18_1-1647257124559.png

3. Now click on Close and apply.

Final Output:-

Samarth_18_2-1647257167643.png

 

Thanks,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Anonymous
Not applicable

Thank you !! I didn't thought about it this way even tho it's so simple, I feel stupid... Thank you a lot !

truptis
Community Champion
Community Champion

Hi @Anonymous ,

You can try this:

Result =IF(country ="FR/ES", calculate(count(columnname), filter(tablename, country ="FR" || Country ="ES")), 
IF(country ="FR/BEL/GR", calculate(count(columnname), filter(tablename, country ="FR" || Country ="GR"|| Country ="BEL"),IF(country ="FR",calculate(count(columnname), filter(tablename, country ="FR"), IF(country ="BEL",calculate(count(columnname), filter(tablename, country ="BEL"), IF(country ="SP",calculate(count(columnname), filter(tablename, country ="SP"), calculate(count(columnname), filter(tablename, country = "GR")))))

@Anonymous -> Please mark this as a solution if it helps you. Thank you.

Anonymous
Not applicable

Hello, thank you for your help! The problem I have with this solution is that I only put a sample of my data, there is way more, so it wouldn't be possible or way too long to write one by one.

Sorry!!

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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