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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
jonnyA
Responsive Resident
Responsive Resident

Average a total

Hello,

Hoping sopmeone can help me average a total.

I am trying to average the "AvgDailyChg" row.  I would greatly appreciate a solution to this problem!

 

I dont know if this will help, but I was given this formula from @Icey, but I do not know how to plug in my Fields or measures with the formula that I was given.  And I am not even suire if this forula will work, fyi.

 

Measure =
IF (
    NOT ( HASONEVALUE ( 'Table'[YearMonth] ) )
        && SELECTEDVALUE ( 'Table'[Product] ) IN { "B", "C" },
    AVERAGE ( 'Table'[Value] ),
    SUM ( 'Table'[Value] )
)

Here are the fields I have for the dataset I am working with.

 
 
 

Microsoft Power BI community 10.12.PNG

2 REPLIES 2
manikumar34
Solution Sage
Solution Sage

@jonnyA , 

Not clear, 

 

if you help with more detail and a sample of it. I wiil try to help you out. 

 

Regards,

Manikumar





If this helps, Appreciate your KUDOS!
Did I answer your question? Mark my post as a solution!


Proud to be a Super User!




Power BI 10.13.PNG

Thank you in advance for your help!

 

I think I am getting closer to my answer using the formula below.  I am trying to average the Total.  As you can see from the screen shot the Total is summing the 3 months.

 

Here is the formula I am currently using ...

Power BI Comm 2 =
IF (
(
NOT ( HASONEVALUE ( 'DateOfServiceAnalysis'[MTHYear_Sort] ) )
&& SELECTEDVALUE ( 'DateOfServiceAnalysis'[MTHYear_Sort] ) IN { "AvgDailyChg" }
)
|| (
NOT ( HASONEVALUE ( 'DateOfServiceAnalysis'[MTHYear_Sort] ) )
&& NOT ( HASONEVALUE ( 'DateOfServiceAnalysis'[AvgDailyChg] ) )
),
AVERAGE ( 'DateOfServiceAnalysis'[AvgDailyChg] ),
SUM ( 'DateOfServiceAnalysis'[AvgDailyChg] )
)
 
Here is the formula I was provided from @Icey via the Power Bi Community...
Measure =
IF (
     (
        NOT ( HASONEVALUE ( 'Table'[YearMonth] ) )
            && SELECTEDVALUE ( 'Table'[Product] ) IN { "B", "C" }
    )
        || (
            NOT ( HASONEVALUE ( 'Table'[YearMonth] ) )
                && NOT ( HASONEVALUE ( 'Table'[Product] ) )
        ),
    AVERAGE ( 'Table'[Value] ),
    SUM ( 'Table'[Value] )
)
 
If you do provide an answer it would be extremely helpful to me if you could also provide the Fields to fill in for the formula.  
For example, which Field I should be using for "Value", "Product", "B" and "C", etc.
 
Thank you so much 🙂

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

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.

March Power BI Update Carousel

Power BI Community Update - March 2026

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