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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Janet_PHQ
Helper I
Helper I

Get global coverage based on conditions

Hello everyone, I would like to seek some advice regarding the following question please.

 

I have 3 tables: 1 is a big fat table for events of different categories across the globe. The 2nd table is a list of unique countries including country code, country names etc. The 3rd one is a small table for a list of unique categories appeared in the big table. I joined table 1 with table 2 by country code, and table 1 with table 3 by category ID. A sample screenshot for table 1 is below for your reference.

 

Screen shot for PBI question.PNG

 

 

 

 

 

 

 

 

 

What I would like to do is to use global coverage for categories such as expos and festivals as my benchmarks to measure against same category coverage for each country. I am thinking this can be achieved by: 

 

1. Create a column "Count" and make it all equal to 1. Then create a measure "Total" = count([count])

 

2. Not sure how to achieve the following:

 

- Count the total events ("Totals") for when category = festivals and expos (only) BUT excluding the count for when country = US (because US is a huge outlier so anything about US will not be counted in the "Totals")

- Count the total events for a single category (festivals or expos) BUT excluding the count for when country = US (for the same reason as above). This one will get "Total festivals" and "Total expos"

 

3. Get the % for each category. This one is easy so DIVIDE("Total festivals", "Totals"), DIVIDE("Total expos", "Totals")

 

Eventually, all the % will be on the same graph (if possible) similar to below:  

 

Global VS Individual.PNG

 

 

 

 

 

 

 

 

 

 

 

Please let me know. Thanks!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

HI @Janet_PHQ,

 

Perhaps you can try to use below formulas to calculate the percent festivals and expos if they suitable for your requirement.

count of festivals and expos %(exclude US)=
DIVIDE(CALCULATE(Count([Count]),FILTER(ALL(Table1),AND([Category]="festivals",[Category]="expos")&&[CountryCode]<>"US"))
,COUNTAX(ALL(Table1),[Category]),0)

Count of festivals or expos %(exclude US)= 
DIVIDE(CALCULATE(Count([Count]),FILTER(ALL(Table1),OR([Category]="festivals",[Category]="expos")&&[CountryCode]<>"US"))
,COUNTAX(ALL(Table1),[Category]),0)

BTW, I found your category column only store single category each row, how did you calculate the count of event who contains multiple categories?

 

Regards,

XIaoxin Sheng

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

HI @Janet_PHQ,

 

Perhaps you can try to use below formulas to calculate the percent festivals and expos if they suitable for your requirement.

count of festivals and expos %(exclude US)=
DIVIDE(CALCULATE(Count([Count]),FILTER(ALL(Table1),AND([Category]="festivals",[Category]="expos")&&[CountryCode]<>"US"))
,COUNTAX(ALL(Table1),[Category]),0)

Count of festivals or expos %(exclude US)= 
DIVIDE(CALCULATE(Count([Count]),FILTER(ALL(Table1),OR([Category]="festivals",[Category]="expos")&&[CountryCode]<>"US"))
,COUNTAX(ALL(Table1),[Category]),0)

BTW, I found your category column only store single category each row, how did you calculate the count of event who contains multiple categories?

 

Regards,

XIaoxin Sheng

Hi Xiaoxin,
 
Thanks for your advice earlier!
I accepted the solution 🙂
 
Can I ask you another related question please?Refer to my question here:

 

Have a good weekend!

it is possible to sahre file 

Hello XIaoxin ,

 

Thanks for your reply! I will try it soon 🙂

 

Each event only has a single category so there is no need to worry about that. 

 

Cheers,

Janet

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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