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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
v-shex-msft
Community Support
Community Support

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

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

5 REPLIES 5
v-shex-msft
Community Support
Community Support

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

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.