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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
mizaskun
Helper II
Helper II

Get correct subtotal in simple measures

Good morning,

 

I am trying to calculate a simple measure subtotal, but I am having problems doing so. 

 

I have the following simple table:

mizaskun_0-1635853671049.png

 

I am trying to calculate the POND 1 and POND 2 %.

 

mizaskun_1-1635853797758.png

I am doing so applying the following formulas:

P1 = sum(PRUEBA[POND 1]) / calculate(sum(PRUEBA[POND 1]), all())
P2 = sum(PRUEBA[POND 2]) / calculate(sum(PRUEBA[POND 2]), all())
 
Then I need to get the product of both %. This is:
mizaskun_2-1635854056280.png

 

I am doing so by applying the formula: 

P1*P2 = PRUEBA[P1]*PRUEBA[P2]
 
And this is the result:
mizaskun_3-1635854090316.png

 

When I try to calculate the new % over the product, it uses the red circled 1,00 as the denominator. I would need this behaviour:

mizaskun_4-1635854188668.png

 

2 / 25 ... 11 / 25 .... and so on.. but it is using 2 / 100 ... 11 / 100 ...

 

mizaskun_5-1635854309385.png

 

Thank you so much! 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@mizaskun , Create a measure like

 

sumx(summarize(Table, Table[persona], table[Region], Table[RIEGO], "_1",[P1]*[P2]) , [_1])

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@mizaskun , Create a measure like

 

sumx(summarize(Table, Table[persona], table[Region], Table[RIEGO], "_1",[P1]*[P2]) , [_1])

It works! Great! Thank you!

 

I need to calculate now the sum of the different P% that we have just calculated with your formula * the VAL field. I am trying something like: 

TOTAL = PRUEBA[P%]*sum(PRUEBA[VAL]), but it sums 11. How could I get the correct value? 
mizaskun_0-1635856368696.png

 

Thank you so much! 

Helpful resources

Announcements
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.