Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hello everyone,
At this moment I am busy with analyzing data in Power BI. My targets are to:
The problem at this moment is that Power BI shows the average per company in rows, but not in the outcome of the average calculation.
Current (wrong) calculation in Power BI for column A:
Calculations that I need for column A:
Overview data:
Current (wrong) outcome in Power BI:
Outcome I need:
Does someone know how it would be possible to show the right outcome in PowerBI?
Thanks in advance. If you need more explanation, please let me know.
Best Regards,
Tom
Solved! Go to Solution.
Hi @TomStaps ,
Here are the steps you can follow:
1. Create measure.
A_Measure =
var _summrize=SUMMARIZE('Table','Table'[Company],"A",AVERAGE('Table'[A]),"B",AVERAGE('Table'[B]),"C",AVERAGE('Table'[C]))
RETURN
IF(
HASONEVALUE('Table'[Company]),AVERAGE('Table'[A]),AVERAGEX(FILTER(_summrize,[A]<>BLANK()),[A]))
B_Measure =
var _summrize=SUMMARIZE('Table','Table'[Company],"A",AVERAGE('Table'[A]),"B",AVERAGE('Table'[B]),"C",AVERAGE('Table'[C]))
RETURN
IF(
HASONEVALUE('Table'[Company]),AVERAGE('Table'[B]),AVERAGEX(FILTER(_summrize,[B]<>BLANK()),[B]))
C_Measure =
var _summrize=SUMMARIZE('Table','Table'[Company],"A",AVERAGE('Table'[A]),"B",AVERAGE('Table'[B]),"C",AVERAGE('Table'[C]))
RETURN
IF(
HASONEVALUE('Table'[Company]),AVERAGE('Table'[C]),AVERAGEX(FILTER(_summrize,[C]<>BLANK()),[C]))
2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @TomStaps ,
Here are the steps you can follow:
1. Create measure.
A_Measure =
var _summrize=SUMMARIZE('Table','Table'[Company],"A",AVERAGE('Table'[A]),"B",AVERAGE('Table'[B]),"C",AVERAGE('Table'[C]))
RETURN
IF(
HASONEVALUE('Table'[Company]),AVERAGE('Table'[A]),AVERAGEX(FILTER(_summrize,[A]<>BLANK()),[A]))
B_Measure =
var _summrize=SUMMARIZE('Table','Table'[Company],"A",AVERAGE('Table'[A]),"B",AVERAGE('Table'[B]),"C",AVERAGE('Table'[C]))
RETURN
IF(
HASONEVALUE('Table'[Company]),AVERAGE('Table'[B]),AVERAGEX(FILTER(_summrize,[B]<>BLANK()),[B]))
C_Measure =
var _summrize=SUMMARIZE('Table','Table'[Company],"A",AVERAGE('Table'[A]),"B",AVERAGE('Table'[B]),"C",AVERAGE('Table'[C]))
RETURN
IF(
HASONEVALUE('Table'[Company]),AVERAGE('Table'[C]),AVERAGEX(FILTER(_summrize,[C]<>BLANK()),[C]))
2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
@TomStaps You have two identical rows - that will not work in Power BI as it always automatically aggregates. I have added an index column to mitigate that.
See attached.
User | Count |
---|---|
92 | |
85 | |
77 | |
66 | |
62 |
User | Count |
---|---|
110 | |
95 | |
95 | |
64 | |
59 |