Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

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
  • 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.

4 Replies

  • 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]
  • 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.

     

  • v-sathmakuri's avatar
    v-sathmakuri
    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.

  • v-sathmakuri's avatar
    v-sathmakuri
    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.