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
ecoale
Helper I
Helper I

Getting totals from 2 matrices in a third matrix

Hi friends, I really need help 😞

 

I have 2 matrices (years 2015 and 2018) with the distribution of students for sex (number and %):

2015:                                 2018:

M: 10, 33,3%                     M: 15, 55,6%

F: 20, 66,7%                       F: 12, 44,4%

n.d.: 1                                n.d.: 3

total: 31                            total: 30

PS the % were got, in PBI desktop, dropping the coloumns "number of students" in values, and then filtering excluding the not available (n.d.)

 

Now, I need to find the way (I mean automaticly with DAX, not manually) to get a third matrix showing the two distribution %:

              2015    2018

M:          33,3%  55,6%

F:            66,7%  44,4%

total:  100,0%  100,0%

 

I tried lots of ways... but I do not find anything... anybody could help me please??

Thanks a lot in advance.

1 ACCEPTED SOLUTION
v-diye-msft
Community Support
Community Support

Hi @ecoale 

 

I created a sample same as yours, but calculate the percentage using calculated column instead of measure:

2015 = IF('2015'[Sex]="n.d",BLANK(),DIVIDE('2015'[Number],CALCULATE(SUM('2015'[Number]),FILTER(ALL('2015'),'2015'[Sex]="F"||'2015'[Sex]="M"))))

2018 = IF('2018'[Sex]="n.d",BLANK(),DIVIDE('2018'[Number],CALCULATE(SUM('2018'[Number]),FILTER(ALL('2018'),'2018'[Sex]="F"||'2018'[Sex]="M"))))

And then the third matrix could be generated with the total percentage

8.png

Pbix attached here for your reference: https://wicren-my.sharepoint.com/:u:/g/personal/dinaye_wicren_onmicrosoft_com/EdbOuB01DW5KulBtcp90dO...

 

Best regards,

Dina Ye

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

View solution in original post

3 REPLIES 3
v-diye-msft
Community Support
Community Support

Hi @ecoale 

 

I created a sample same as yours, but calculate the percentage using calculated column instead of measure:

2015 = IF('2015'[Sex]="n.d",BLANK(),DIVIDE('2015'[Number],CALCULATE(SUM('2015'[Number]),FILTER(ALL('2015'),'2015'[Sex]="F"||'2015'[Sex]="M"))))

2018 = IF('2018'[Sex]="n.d",BLANK(),DIVIDE('2018'[Number],CALCULATE(SUM('2018'[Number]),FILTER(ALL('2018'),'2018'[Sex]="F"||'2018'[Sex]="M"))))

And then the third matrix could be generated with the total percentage

8.png

Pbix attached here for your reference: https://wicren-my.sharepoint.com/:u:/g/personal/dinaye_wicren_onmicrosoft_com/EdbOuB01DW5KulBtcp90dO...

 

Best regards,

Dina Ye

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

Hi!

 

Can you please reupload the pbix file?

 

Thank you!

My friend thank a lot!

precious helpppppp 🙂

thanks

have a nice day

Alessio

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.