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
lennox25
Helper V
Helper V

How to work out averages based on many categories

Can someone help me? I need to create a visual that displays the average per category? How do I do this? Can it be done with one measure/column?

 

There are filters on visual on store number and date.

 

I have uploaded a sample power bi file which will hopefully explain what Im after.

 

 

https://drive.google.com/file/d/1fFS2O-SYE1IBKjfJHlgc8CPTEHNi86-i/view?usp=sharing 

4 REPLIES 4
Mahesh0016
Super User
Super User

Mahesh0016_0-1670326153771.png

I hope this solution is helpful.
Thank You!

Hi @Mahesh0016  Thank you, but I cant get this to work. Have you looked at my sample data? Does it work for you?

Hi @lennox25 ,

 

Here I suggest you to create a measure by below code.

Avg =
CALCULATE (
    AVERAGE ( 'TableName'[COLUMN1] ),
    FILTER (
        ALLSELECTED ( [Store Number], [Date] ),
        'TableName'[Category] = MAX ( 'TableName'[Category] )
    )
)

I couldn't get access to your sample file from your link.

RicoZhou_0-1670490014540.png

If this reply still couldn't help you solve your issue, please share a new link with me.

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-rzhou-msft I still cant get it to work. Apologies re access to file, you should ahve it now, Many Thanks

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.