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.
Hello. I am trying to do following:
I have measure A and measure B. Then I need to do DIVIDE(A,B), to get C.
So, for example, I have following results:
A | B | C |
10 | 2 | 5 |
8 | 4 | 2 |
12 | 3 | 4 |
I need to get the SUM of C. Let's say 5+2+4 = 11.
Instead, I get (10+8+12) / (2+4+3) which is a completelly different result.
I am grouping this by Country, but all, the Country column, measure A and measure B are all being calculated, are not physical values stored on a table.
Said that, the visual I have is something like following. I which to have a Total Row saying 11, as I show in the example below, but instead I get 3.33, as it calculates SUM(A) / SUM(B).
Country | Divided value |
Mexico | 5 |
Canada | 2 |
Japan | 4 |
Total | 11 |
Please provide your comments, it would be really helpful to me.
Solved! Go to Solution.
Hi, @jjac_pbi_1979
You can try the following methods. The function IF (HASONEVALUE ( )) controls the output value of total.
Divided value =
IF (
HASONEVALUE ( 'Table'[Country] ),
DIVIDE ( SUM ( 'Table'[A] ), SUM ( 'Table'[B] ) ),
SUMX (
SUMMARIZE (
'Table',
'Table'[Country],
"DIVIDE", DIVIDE ( SUM ( 'Table'[A] ), SUM ( 'Table'[B] ) )
),
[DIVIDE]
)
)
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @jjac_pbi_1979
You can try the following methods. The function IF (HASONEVALUE ( )) controls the output value of total.
Divided value =
IF (
HASONEVALUE ( 'Table'[Country] ),
DIVIDE ( SUM ( 'Table'[A] ), SUM ( 'Table'[B] ) ),
SUMX (
SUMMARIZE (
'Table',
'Table'[Country],
"DIVIDE", DIVIDE ( SUM ( 'Table'[A] ), SUM ( 'Table'[B] ) )
),
[DIVIDE]
)
)
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Create a measure like
_Divide SUM = SUMX(Values(table[country]), Divide(MeasureA,MeasureB))
Proud to be a Super User!
Thank you so much. Will try that and will confirm if works to accept it as solution.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
108 | |
100 | |
78 | |
64 | |
58 |
User | Count |
---|---|
148 | |
113 | |
97 | |
84 | |
67 |