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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Katja262373
Helper I
Helper I

Dear POWER BI experts, I need your advice over my DAX-formulas!!

image.png

I am currently analyzing a survey (approx.60.0000 respondents in 30 European countries) on the topic of xenophobia.

More precisely: how many women and men in each country (in % of the sample) are xenophobic.

 

Ive checked a bit of this data by Czech Republic (CZ in the table - out of 2476 respondents from CZ 574 have answered xenophobic questions (3 times NO to migrants, i.e. 4-4-4 in the answers (column names [impcntr], [imsmetn], [imdfetn]))

-and these are 259 men and 315 women (i.e. of all respondents in the Czech Republic, so 10.46% and 12.72% female out if 2476).

This is exactly what I need for each country in Europe (the percentages).

 

Also --the gender is mentioned as -1 male and 2-female from the [gndr] column.

 

I’ve made these formulas in the first place:

 

MeasureMale= CALCULATE(COUNTAX('male-female xenophobes','male-female xenophobes'[gndr]), 'male-female xenophobes'[gndr]="1" && 'male-female xenophobes'[impcntr]=4 && 'male-female xenophobes'[imsmetn]=4 && 'male-female xenophobes'[imdfetn]=4)

 

MeasureFemale = CALCULATE(COUNTAX('male-female xenophobes','male-female xenophobes'[gndr]), 'male-female xenophobes'[gndr]="2" && 'male-female xenophobes'[impcntr]=4 && 'male-female xenophobes'[imsmetn]=4 && 'male-female xenophobes'[imdfetn]=4)

 

Then I’ve made some New Measures to calculate a percentage: how many men out of each country are xenophobic and how many women (in % out of samples per country).

 

percentage xenM per country = 100*divide([MeasureMale], COUNTROWS(ALLNOBLANKROW('male-female xenophobes')))

 

percentage xenF per country = 100*divide([MeasureFemale], COUNTROWS(ALLNOBLANKROW('male-female xenophobes')))

 

However, the resulting graph seems incorrect.. what could be the reason, maybe someone can advise??

 

Further I need to calculate how many man and women (in %) out of Entire EU sample from my datasheet (approx.60.000) is xenophobic.

Could anyone help me here?

 

Thank you a lot in advance!!
Katia

2 REPLIES 2
lbendlin
Super User
Super User

Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot). Leave out anything not related to the issue.
If you are unsure how to do that please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.

If you want to get answers faster please refer to https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Thank you for your kind response! I've actually already solved this case. Will try to paste a workable formula in my next message 

Helpful resources

Announcements
Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.