cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
Anonymous
Not applicable

Adding certain rows from a table using a condition

Imagine I have a table that has two columns, Units Sold and Product :

 

      Units Sold        Product

           3                   Fruit

           5                   Beverage

           2                   Fruit

           1                   Fruit

           4                   Beverage

           7                   Sweets

 

What is the right DAX expression that will give me the average number of sold units of each product type?

So the output that I want to get is a plot of average unit sold vs product type, where the average for fruit is 3.67, 3.14 for sweets, and 2.44 for fruit.

 

      

 

1 REPLY 1
benfedit
Advocate I
Advocate I

Hi Johnray,

 

I don't  think that you need to create a measure for this.

You can simply create a bar chart in PowerBI and drag your existing measure "Unit Sold" in Value and "Product" into the Axis part then by clicking on "UnitSold" you can set the summarization to average.

Capture.PNG

 

You can still create a measue if you want: Measure = AVERAGE(Table1[UnitSold]) 

 

 

 

 

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors