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
Anonymous
Not applicable

Keep row values as sum, but change total as average in matrix

As the title implies, is it possible to change the total of a matrix into average without changing the row values (sum)? I have seen solutions where it involves modifying the column and just creating measures for column values, but the column headers should be dynamic as they are date columns and they will add on the longer the time goes. Kindly see sample data below. I know there is a way to have Monthly row totals be made into measures and show that into the table instead, but that is not really dynamic. Can anyone please help? 

Thank you.

noobpowerbiuser_0-1667362594355.png

 

1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi, @Anonymous ;

You could create a measure

Measure =
IF (
    ISINSCOPE ( 'Table'[Date].[Year] ),
    SUM ( 'Table'[values] ),
    AVERAGEX (
        SUMMARIZE (
            'Table',
            [Catetory],
            [Date].[Year],
            [Date].[Month],
            "1", SUM ( 'Table'[values] )
        ),
        [1]
    )
)

The final show:

vyalanwumsft_0-1667443931190.png


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-yalanwu-msft
Community Support
Community Support

Hi, @Anonymous ;

You could create a measure

Measure =
IF (
    ISINSCOPE ( 'Table'[Date].[Year] ),
    SUM ( 'Table'[values] ),
    AVERAGEX (
        SUMMARIZE (
            'Table',
            [Catetory],
            [Date].[Year],
            [Date].[Month],
            "1", SUM ( 'Table'[values] )
        ),
        [1]
    )
)

The final show:

vyalanwumsft_0-1667443931190.png


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

jdbuchanan71
Super User
Super User

@Anonymous 

you can use HASONEVALUE to check if you are on a Resource Type row like this.

Amount Measure = 
IF ( 
    HASONEVALUE ( 'Table'[Resource Type] ), 
    SUM ( 'Table'[Amount] ), 
    AVERAGEX ( VALUES ( 'Table'[Resource Type] ), CALCULATE ( SUM ('Table'[Amount] ) ) ) 
)

jdbuchanan71_1-1667366296789.png

 

Anonymous
Not applicable

Sorry, this makes the column totals as average, but I want the row totals in average. Basically just switched around

amitchandak
Super User
Super User

@Anonymous , Assume you are using a measure M1 in the matrix

 

AverageX(Summarize(Fact, Date[FY Year], Date[Qtr], Fact[Resource Group]), [M1])

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.