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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
jonathanmathes
Regular Visitor

Column total as average

I have a table with two columns of data: Absenteeism and Turnover.

In the total of the Absenteeism column, the BI is bringing the average of the months. Already in the total of the Turnover column he is doing the sum.

I need him to also average the turnover and not the sum.

 

jonathanmathes_0-1651768497318.png

 

Can anyone help me?

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@jonathanmathes , You can switch total to avg or sum depending on need using isinscope

 

if(isinscope(Table[Year]) && Not(Isinscope(Table[Month])) , sumx(summarize(Table, Table[Year], Table[Month], "_1", [measure]), [_1]), [Measure])

 

or

 

 

if(isinscope(Table[Year]) && Not(Isinscope(Table[Month])) , AverageX(summarize(Table, Table[Year], Table[Month], "_1", [measure]), [_1]), [Measure])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi @jonathanmathes ,

 

Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or if you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.

 

Best Regards,
Eyelyn Qin

Anonymous
Not applicable

Hi @jonathanmathes ,

Eyelyn9_0-1652236756809.png

Is there any update?

 

 

Best Regards,
Eyelyn Qin

Good Morning,
Sorry for the delay, I was involved in another personal project.

I did as you said using IfInScope.
The final totalizer was OK, but the column one still adds up.

 

.ROTavg =
if(isinscope('Calendar'[.Ano]) && Not(Isinscope('Calendar'[.MesDescricao])) , averageX(summarize('Calendar','Calendar'[.Ano],'Calendar'[.MesDescricao],"_1",[.TurnoverPeriodo]),[_1]),[.TurnoverPeriodo])
 
jonathanmathes_0-1657192497434.png

 

Try:

ROTavg =
IF (
    ISINSCOPE ( 'Calendar'[.MesDescricao] ),
    [.TurnoverPeriodo],
    AVERAGEX (
        SUMMARIZE (
            'Calendar',
            'Calendar'[.Ano],
            'Calendar'[.MesDescricao],
            "_1", [.TurnoverPeriodo]
        ),
        [_1]
    )
)




Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






amitchandak
Super User
Super User

@jonathanmathes , You can switch total to avg or sum depending on need using isinscope

 

if(isinscope(Table[Year]) && Not(Isinscope(Table[Month])) , sumx(summarize(Table, Table[Year], Table[Month], "_1", [measure]), [_1]), [Measure])

 

or

 

 

if(isinscope(Table[Year]) && Not(Isinscope(Table[Month])) , AverageX(summarize(Table, Table[Year], Table[Month], "_1", [measure]), [_1]), [Measure])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

I have never used isinscope, I will read about it and test it.
post the result later

 

Thanks

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.