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
Anonymous
Not applicable

Help With Seasonality

Hi,
I am trying to calculate the total per financial account, average per financial account, variance by department.  The data looks like the first 4 columns and I want to calculate the last 3 columns by account (Sales, Payroll, etc, etc).  I can't get the filtering to work on my average x. Can anyone please help?  Here is how it might look in Excel with the first 4 being the data, the last 3 the results.   Thanks!

DeptMonthSalespayrollAverage for Period SalesAverage for YearVariance for whole period
11/1/2023500200557.5527.5-27.5
12/1/2023505201557.5527.5-22.5
13/1/2023510202557.5527.5-17.5
14/1/2023515203557.5527.5-12.5
15/1/2023520204557.5527.5-7.5
16/1/2023525205557.5527.5-2.5
17/1/2023530206557.5527.52.5
18/1/2023535207557.5527.57.5
19/1/2023540208557.5527.512.5
110/1/2023545209557.5527.517.5
111/1/2023550210557.5527.522.5
112/1/2023555211557.5527.527.5
21/1/2023560212557.5587.5-27.5
22/1/2023565213557.5587.5-22.5
23/1/2023570214557.5587.5-17.5
24/1/2023575215557.5587.5-12.5
25/1/2023580216557.5587.5-7.5
26/1/2023585217557.5587.5-2.5
27/1/2023590218557.5587.52.5
28/1/2023595219557.5587.57.5
29/1/2023600220557.5587.512.5
210/1/2023605221557.5587.517.5
211/1/2023610222557.5587.522.5
212/1/2023615223557.5587.527.5
1 ACCEPTED SOLUTION
v-sathmakuri
Community Support
Community Support

Hi @Anonymous ,

 

Thank you for reaching out to Microsoft Fabric Community.

Thank you @Ashish_Mathur  and @parry2k  for prompt repsonse.

 

Below are the columns which i have created to meet the requirements. I have attached the pbix for reference.

 
Average for Period Sales = AVERAGE('Sheet'[Sales])
 
Average for Year Sales =
CALCULATE(
    AVERAGE('Sheet'[Sales]),
    ALLEXCEPT('Sheet', 'Sheet'[Dept])
)
 
Variance Sales =
'Sheet'[Sales] - [Average for Year Sales]

 

If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it! 

 

Thanks & Regards,

Rekha,

CustomerSupportTeam.

View solution in original post

4 REPLIES 4
v-sathmakuri
Community Support
Community Support

Hi @Anonymous ,

 

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

 

Thank you.

v-sathmakuri
Community Support
Community Support

Hi @Anonymous ,

 

Thank you for reaching out to Microsoft Fabric Community.

Thank you @Ashish_Mathur  and @parry2k  for prompt repsonse.

 

Below are the columns which i have created to meet the requirements. I have attached the pbix for reference.

 
Average for Period Sales = AVERAGE('Sheet'[Sales])
 
Average for Year Sales =
CALCULATE(
    AVERAGE('Sheet'[Sales]),
    ALLEXCEPT('Sheet', 'Sheet'[Dept])
)
 
Variance Sales =
'Sheet'[Sales] - [Average for Year Sales]

 

If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it! 

 

Thanks & Regards,

Rekha,

CustomerSupportTeam.

Ashish_Mathur
Super User
Super User

Hi,

Try these calculated column formulas

Averge for period sales = CALCULATE(AVERAGE(Data[Sales]),ALL(Data))
Averge for year = CALCULATE(AVERAGE(Data[Sales]),FILTER(Data,Data[Dept]=EARLIER(Data[Dept])))
Variance for whole period = Data[sales]-Data[Averge for year]

Hope this helps.

Ashish_Mathur_0-1741996845376.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
parry2k
Super User
Super User

@Anonymous try these measures:

 

Avg for Period Sales = CALCULATE ( AVERAGE ( 'Table'[Sales] ), ALLSELECTED () )

Avg for Year = CALCULATE ( AVERAGE ( 'Table'[Sales] ), ALLSELECTED (), VALUES ( 'Table'[Dept] ) )

Variance = SUM ( 'Table'[Sales] )  - [Avg for Year]


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

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.