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 guys,
I am new into PowerBI, and I am struggling to create a new measure.
In my dataset, I have a column with all type of actions realized throughout the year, and there could be the same actions in different lines with different values. For each line (action) there is a column with the number of meters covered and the number of days it took to be accomplished. Then I added another column to calculate the ratio for each line.
Now I want to create a graphic on PowerBI Desktop that can show me the average ratio per type of action. But when I insert the ratio it only appears to option to count, instead of average. I have searched and I think that the only way is to create a new measure with the AverageX function, but I can´t figure out how.
Hope you can understand my problem and help me out!
Thanks,
Miguel Freire
Solved! Go to Solution.
Hi @Anonymous ,
Sorry for that we don’t understand your requirement clearly. But we create a sample and find the following ways you can refer.
1. Create a calculate column to calculate the ratio of each row.
every row = DIVIDE('Table'[values],SUM('Table'[values]))
2. Then we can create a column to calculate the average ratio of per type of actions.
average ratio per type of action =
var x = CALCULATE(SUM('Table'[every row]),FILTER('Table','Table'[actions]=EARLIER('Table'[actions])))
var y = CALCULATE(COUNT('Table'[actions]),FILTER('Table','Table'[actions]=EARLIER('Table'[actions])))
return
DIVIDE(x,y)
If it doesn’t meet your requirement, could you please provide a mockup sample based on fake data or describe the fields of each tables and the relations between tables simply?
It will be helpful if you can show us the exact expected result based on the tables.
Please upload your files to OneDrive For Business and share the link here. Please don't contain any Confidential Information or Real data in your reply.
BTW, pbix as attached.
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Sorry for that we don’t understand your requirement clearly. But we create a sample and find the following ways you can refer.
1. Create a calculate column to calculate the ratio of each row.
every row = DIVIDE('Table'[values],SUM('Table'[values]))
2. Then we can create a column to calculate the average ratio of per type of actions.
average ratio per type of action =
var x = CALCULATE(SUM('Table'[every row]),FILTER('Table','Table'[actions]=EARLIER('Table'[actions])))
var y = CALCULATE(COUNT('Table'[actions]),FILTER('Table','Table'[actions]=EARLIER('Table'[actions])))
return
DIVIDE(x,y)
If it doesn’t meet your requirement, could you please provide a mockup sample based on fake data or describe the fields of each tables and the relations between tables simply?
It will be helpful if you can show us the exact expected result based on the tables.
Please upload your files to OneDrive For Business and share the link here. Please don't contain any Confidential Information or Real data in your reply.
BTW, pbix as attached.
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous , you might to avg of count , refer
https://community.powerbi.com/t5/Desktop/SUM-of-AVERAGE/td-p/197013
Hi @Anonymous
try create a measure and put it to Y-Axis
Measure = CALCULATE(AVERAGE(Table[Ratio]), ALLEXCEPT(Table, Table[ActionType]) )
@Anonymous Read this post to get your answer quickly.
https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
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 |
---|---|
104 | |
101 | |
79 | |
72 | |
64 |
User | Count |
---|---|
142 | |
108 | |
101 | |
81 | |
74 |