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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Khaoula_Farissi
Frequent Visitor

dividing two measures

Hello

this is my data

IdBrandM1BrandM2
Wave
1ADw3
2BDw2
3CDw2
4DCw2
5AAw1
6BBw2
7CDw3
8ACw3
9BDw2
10CDw3
11DDw3
12DCw1
13DAw3
14CBw1
15ADw2
16BCw2
17DCw3
18CAw3
19ABw1

i want to calculate the percentage of column total of BrandM1 and BrandM2:

Row Labelsw1w2w3Grand Total
A50,00%14,29%25,00%26,32%
B0,00%57,14%0,00%21,05%
C25,00%14,29%37,50%26,32%
D25,00%14,29%37,50%26,32%
Grand Total100,00%100,00%100,00%100,00%

 

Row Labelsw1w2w3Grand Total
A25,00%0,00%25,00%15,79%
B50,00%14,29%0,00%15,79%
C25,00%28,57%25,00%26,32%
D0,00%57,14%50,00%42,11%
Grand Total100,00%100,00%100,00%100,00%

 

then i want to divide them (table1/table2)

Brandsw1w2w3
A2,00#DIV/0!1,00
B0,004,00#DIV/0!
C1,000,501,50
D#DIV/0!0,250,75
3 REPLIES 3
amitchandak
Super User
Super User

@Khaoula_Farissi , You want to use M1 and M2 in same row, that is bit different. I create a file, Check that. You need check you second martix is grouping M2 or Using M2 in formula but grouping M1, based on that you have to change formula.

 

Please find the file attached after signature.

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Khaoula_Farissi
Frequent Visitor

i apperciate your help @amitchandak 

but i didn't get the correct result

tempsnip.png

amitchandak
Super User
Super User

@Khaoula_Farissi , You can have measures like

M1 = divide(countrows(Table),calculate(countrows(Table), allexpect(Table, Table[wave])))

M2 = divide(countrows(Table),calculate(countrows(Table), allexpect(Table, Table[BrandM1])))

M3 = divide(countrows(Table),calculate(countrows(Table), allexpect(Table, Table[BrandM2])))

 

last table

 

measure 1 =
var M1 = divide(countrows(Table),calculate(countrows(Table), allexpect(Table, Table[wave])))
var M2 = divide(countrows(Table),calculate(countrows(Table), allexpect(Table, Table[BrandM1])))
return
divide(M1,M2)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.