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
CherC
Frequent Visitor

PBI DAX: Add rolling avg instead of subtotal to matrix table with measures for rows

Hi All, have a Power BI DAX question: trying to add another column to this matrix table example. Instead of the column subtotal, I want the average of the previous 6 months, (rolling avg). Each row in the table is a measure. Is there a way to do this?

Screenshot 2023-04-19 092313.png

3 REPLIES 3
v-rongtiep-msft
Community Support
Community Support

Hi @CherC ,

Please have a try.

Create  measures.
Sum measures values.

measure_sum=[measure A]+[measure B]+[measure C]+[measure D]

Then change the measure total value.

measure =
VAR _2 =
    SUMMARIZE ( table, table[date], "aaa", [measure_sum] )
RETURN
    IF ( ISINSCOPE ( table[date] ), [measure_sum], AVERAGEX ( _2, [aaa] ) )

 

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

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

So, I created the measures successfully, but since the total column is a built-in feature, where would I put the 2nd measure from above?  Since it's a matrix table, it will only let me put the dates in the column field section and it certainly isn't an extra row.  Is there somewhere to substitute this measure for the total column?

Hi @CherC ,

You only need to put the second measure into the matrix.

Like the following:

vrongtiepmsft_0-1682384456425.png

Solved: How to remove duplicates count - Microsoft Power BI Community

 

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

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

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.