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.
Hi all,
I'm struggling to wrap my head around the following.
My report looks like this:
EDIT: PBI file can be found here.
The source tables are the three on top: Products, Entries & Durations.
Now, I created two (quite complex) measures based on the data in those source tables and a separate calendar table (which is referred to by the slicer on top). Those measures are represented in the bottom graph, over time: 'Measure for Visual X' & 'Measure for Visual Y'.
What I need to do now, is create a KPI that calculates a percentage of X / (X + Y), so in the example above it would be 0,6/(2+1,4 + 0,6) = 15%.
As you can see, I tried two variations, but I'm unable to get to the desired 15% result:
This one gives 20%:
Percentage = DIVIDE([Measure for Visual Y],[Measure for Visual X]+[Measure for Visual Y])
And this one gives 43%:
Percentage (AVG) = DIVIDE(AVERAGEX(Entries,[Measure for Visual Y]),AVERAGEX(Entries,[Measure for Visual X])+AVERAGEX(Entries,[Measure for Visual Y]))
Any ideas on how to get 15%? 😵
Solved! Go to Solution.
Please try this expression that returns 15%
New Measures =
VAR x =
SUMX ( 'calendar', [Measure for Visual X] )
VAR y =
SUMX ( 'calendar', [Measure for Visual Y] )
RETURN
DIVIDE ( y, x + y )
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Please try this expression that returns 15%
New Measures =
VAR x =
SUMX ( 'calendar', [Measure for Visual X] )
VAR y =
SUMX ( 'calendar', [Measure for Visual Y] )
RETURN
DIVIDE ( y, x + y )
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
@zudar , this should be like
Percentage (AVG) = DIVIDE([Measure for Visual Y],A[Measure for Visual X]+Entries,[Measure for Visual Y])
@zudar , Just use the measure no need of nay aggregation on top of it
Percentage (AVG) = DIVIDE([Measure for Visual Y],[Measure for Visual X]+[Measure for Visual Y])
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 |
---|---|
110 | |
96 | |
77 | |
63 | |
55 |
User | Count |
---|---|
143 | |
109 | |
89 | |
84 | |
66 |