Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Khramana
Frequent Visitor

Need help with Measure condition

Hello Power BI lovers!

I'm still in process of Power BI expressions acqusition and need some advice how to make a proper expression.

I have table: "Device statistics"

In "Device statistics" I have these columns:

Device NameRAM in FreezeCity
AN12345GI520Berlin
KR5562KOT800Paris
LO894H78D500Berlin
PI4H49JTH7727Ankara
HI5O89FHE768Minsk
KK456HTJW520Zagreb


I need to show the average RAM in freeze by cities like (sum of RAM of the devices by location)/(quantity of the devices in this location).
To see: Berlin - 510, Paris - 800, Zagreb - 520, etc

If I chose Pie chart, put "RAM in Freeze" in Values, chose "Average" "City", put "City" in Details, it calculates average from the whole sum like 520+800+500+727+768+520.

Could you please advise how I can figure it out correctly?


Thanks in advance!

4 REPLIES 4
BA_Pete
Super User
Super User

Hi @Khramana ,

 

You should just be able to create a measure like this and use it in the Values section of your pie chart:

_averageRamInFreeze = AVERAGE(yourTable[RAM in Freeze])

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




I guess I figured it out using your measure as an example just replacing Average with Median and changing widget to card for better vizualization.

Thank you very muh! 🙂

 

I'm not sure what your expected output was, but the AVERAGE measure works fine for me:

 

BA_Pete_0-1681890775812.png

 

To get averages just over City, you must only have [City] and the measure in the visual (or filter context).

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Hello @BA_Pete 

Thank you for the reply!
But in this case it shows average in total taking all the cities. But not average for Berlin, Paris, etc...

This day I understood that the most exact way to understand the RAM will be to get Median by the cities or Percentile, seems that it make the question a bit more complicated too... Thinking about to make one more post with a question how to get Fashion for this case..

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors