Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.