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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
JKG
Frequent Visitor

Add New Measure based on Column in Matrix visualization

I have a matrix visualization that I created in PowerBI that looks like this.  What I want to do is add a row (like the Total Row) that shows the average Hours/Pilot for the month subtotaled by the Equipment type.  The number is a summation for each individual, so when I tried to add an average, it wanted to average the underlying data for the summation.  Any ideas?

 

Data sample.png

1 ACCEPTED SOLUTION
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @JKG,

 

I created a similar demo. Please download it from the attachment. 

The problem here is we can't add a row. But we can get the result in the Total row. Please refer to the snapshot below.

totalIsEverage =
IF (
    HASONEVALUE ( DimProduct[ColorName] ),
    SUM ( Sales[SalesQuantity] ),
    AVERAGEX (
        SUMMARIZE (
            Sales,
            'Calendar'[Datekey].[Year],
            'Calendar'[Datekey].[Month],
            DimProduct[BrandName],
            DimProduct[ColorName],
            "totalSales", SUM ( Sales[SalesQuantity] )
        ),
        [totalSales]
    )
)

Add-New-Measure-based-on-Column-in-Matrix-visualization

 

Best Regards,

Community Support Team _ Dale
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

2 REPLIES 2
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @JKG,

 

I created a similar demo. Please download it from the attachment. 

The problem here is we can't add a row. But we can get the result in the Total row. Please refer to the snapshot below.

totalIsEverage =
IF (
    HASONEVALUE ( DimProduct[ColorName] ),
    SUM ( Sales[SalesQuantity] ),
    AVERAGEX (
        SUMMARIZE (
            Sales,
            'Calendar'[Datekey].[Year],
            'Calendar'[Datekey].[Month],
            DimProduct[BrandName],
            DimProduct[ColorName],
            "totalSales", SUM ( Sales[SalesQuantity] )
        ),
        [totalSales]
    )
)

Add-New-Measure-based-on-Column-in-Matrix-visualization

 

Best Regards,

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

Thank you so much!  It worked.  I also discovered it worked to flip the data and add a calculated column using the following formula....

 

Avg Pilot BH = SUMX(BH_PER_PILOT,BH_PER_PILOT[ACT_BLK_TM]/DISTINCTCOUNT(BH_PER_PILOT[PILOT_EMP_NBR]))
 
Thanks again!

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.