Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
I'm a little rusty with Power BI so please forgive me.
I have a table with a sales column that looks like this. Let's call it 'Table1'
Location Sales
A 500
B 1000
C 750
D 250
E 1500
I have added a datacard that just calculates the average using the dropdown in the fields pane. Simple enough, right?
When I make a table visual, what I want is a calculate column or measure that shows the average for all locations. So, since the average across all (and the value in my datacard) is 800, I want the output to be this
Location Sales Organization Average
A 500 800
B 1000 800
C 750 800
D 250 800
E 1500 800
That way, I can create a rankx column and rank the locations. I understand that I can just sort the column, but I will be applying this logic to about 5 different areas and want to create a scoring system. I know I have to use ALLSELECTED or ALL but for some reason this is giving me a hard time. Any help would be appreciated, thanks!
Solved! Go to Solution.
Hi , @water-guy-5
According to your description, you want to get the average of the Location.
Here are the steps you can refer to :
[1]If you want to add a calculated column , you can click "New Column" and enter this:
Average Column = AVERAGEX('Table',CALCULATE(SUM('Table'[Sales]) ,ALLEXCEPT('Table','Table'[Location])))
The result is as follows:
[2]If you want to create a measure you can click "New measure" and enter this:
Average = AVERAGEX( ALLSELECTED('Table'[Location]) , CALCULATE(SUM('Table'[Sales])))
The result is as follows:
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi,
To be able to rank the locations, you do not need to create a column with those averages. Try these measures:
Total = sum(Data[Sales])
Rank = rankx(allselected(Data[Locations]),[Total])
Hope this helps.
Hi , @water-guy-5
According to your description, you want to get the average of the Location.
Here are the steps you can refer to :
[1]If you want to add a calculated column , you can click "New Column" and enter this:
Average Column = AVERAGEX('Table',CALCULATE(SUM('Table'[Sales]) ,ALLEXCEPT('Table','Table'[Location])))
The result is as follows:
[2]If you want to create a measure you can click "New measure" and enter this:
Average = AVERAGEX( ALLSELECTED('Table'[Location]) , CALCULATE(SUM('Table'[Sales])))
The result is as follows:
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
105 | |
99 | |
99 | |
38 | |
37 |
User | Count |
---|---|
156 | |
121 | |
73 | |
73 | |
63 |