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

How to Calculate Average Based on Column

Hi guys,

 

I don't know how to explain better, but I'm struggling to find a solution to it. My question is, how do I create another average of "Enterprise" measure that is based on a column? like in Jan

 

Capture.PNG

Here is my measure

Measure = DIVIDE(SUM(Data[Unit Cost]),SUM(Data[Total]),BLANK())

 

Here is the dummy report pbix

 

Thanks a lot

1 ACCEPTED SOLUTION
AlB
Super User
Super User

Hi @Stuznet

 

Try this measure in values of the matrix visual you have in the file. And set row subtotals to On

 

Measure2 =
AVERAGEX (
    VALUES ( Data[Region] );
    DIVIDE (
        CALCULATE ( SUM ( Data[Unit Cost] ) );
        CALCULATE ( SUM ( Data[Total] ) )
    )
)

 

Code formatted with   www.daxformatter.com

View solution in original post

2 REPLIES 2
AlB
Super User
Super User

Hi @Stuznet

 

Try this measure in values of the matrix visual you have in the file. And set row subtotals to On

 

Measure2 =
AVERAGEX (
    VALUES ( Data[Region] );
    DIVIDE (
        CALCULATE ( SUM ( Data[Unit Cost] ) );
        CALCULATE ( SUM ( Data[Total] ) )
    )
)

 

Code formatted with   www.daxformatter.com

@AlB Thank you so much, this is exactly what I've been looking for.

Capture.PNG

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.