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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Alpesh
Helper I
Helper I

Followers % Chg when data is accumulated - Max/Last Date

Trying to calculate % Chg on Social Media followers however, the data that is given is accumulated:

 

How can this be done for last quarter vs. previous closed qtr? I have a calendar table with date offsets, however, the measure is just summing the total for the entire quarter and not pickng the last/max date in the last quarter....?

 

BrandNetworkDateFollowers
XYZFacebook01/01/202415000
XYZFacebook02/01/202415200
XYZFacebook03/01/202415300
XYZInstagram01/01/202422500
XYZInstagram02/01/202425000
    
    
    
    
1 ACCEPTED SOLUTION
suparnababu8
Super User
Super User

Hi @Alpesh 

we need to adjust your DAX formulas to ensure they correctly calculate the percentage changes and follower counts for the specified periods. Here’s how you can do it:

Calculation Groups

  1. Previous Quarter: 

 

Previous Quarter = 
CALCULATE(
    SELECTEDMEASURE(), 
    'Calendar'[CurQuarterOffset] = -1
)

 

  • Current Quarter -2:

 

Current Quarter -2 = 
CALCULATE(
    SELECTEDMEASURE(), 
    'Calendar'[CurQuarterOffset] = -2
)

 

  •  
  • % Chg Qtr vs. YAG: 

 

% Chg Qtr vs. YAG = 
DIVIDE(
    CALCULATE(
        SELECTEDMEASURE(), 
        'Dynamic Calculation Group'[Dynamic Periods] = "Previous Quarter"
    ) - 
    CALCULATE(
        SELECTEDMEASURE(), 
        'Dynamic Calculation Group'[Dynamic Periods] = "Closed Quarter YAG"
    ),
    CALCULATE(
        SELECTEDMEASURE(), 
        'Dynamic Calculation Group'[Dynamic Periods] = "Closed Quarter YAG"
    )
)

 

  • Previous Month:

 

Previous Month = 
CALCULATE(
    SELECTEDMEASURE(), 
    'Calendar'[CurMonthOffset] = -1
)

 

These measures should help you calculate the required metrics and percentage changes for your social media followers. 

  1.  

View solution in original post

4 REPLIES 4
suparnababu8
Super User
Super User

Hi @Alpesh 

we need to adjust your DAX formulas to ensure they correctly calculate the percentage changes and follower counts for the specified periods. Here’s how you can do it:

Calculation Groups

  1. Previous Quarter: 

 

Previous Quarter = 
CALCULATE(
    SELECTEDMEASURE(), 
    'Calendar'[CurQuarterOffset] = -1
)

 

  • Current Quarter -2:

 

Current Quarter -2 = 
CALCULATE(
    SELECTEDMEASURE(), 
    'Calendar'[CurQuarterOffset] = -2
)

 

  •  
  • % Chg Qtr vs. YAG: 

 

% Chg Qtr vs. YAG = 
DIVIDE(
    CALCULATE(
        SELECTEDMEASURE(), 
        'Dynamic Calculation Group'[Dynamic Periods] = "Previous Quarter"
    ) - 
    CALCULATE(
        SELECTEDMEASURE(), 
        'Dynamic Calculation Group'[Dynamic Periods] = "Closed Quarter YAG"
    ),
    CALCULATE(
        SELECTEDMEASURE(), 
        'Dynamic Calculation Group'[Dynamic Periods] = "Closed Quarter YAG"
    )
)

 

  • Previous Month:

 

Previous Month = 
CALCULATE(
    SELECTEDMEASURE(), 
    'Calendar'[CurMonthOffset] = -1
)

 

These measures should help you calculate the required metrics and percentage changes for your social media followers. 

  1.  
Alpesh
Helper I
Helper I

Here's the excel file: https://docs.google.com/spreadsheets/d/1NuK9mEQoIWvocDh5GI8HSAnH4Ent1OnO/edit?usp=sharing&ouid=10320...

 

Requirement is:

 

Last Qtr Closed: Sum of all Networks & breakdown by network: % Chg vs. previous closed qtr, % chg vs. closed qtr YAG. We'd also need to display the followers count at the last day of the closed quarter

Last Month Closed: Sum of all Networks & breakdown by network: % Chg vs. previous closed month, % chg vs. closed month YAG. We'd also need to display the followers count at the last day of the closed month

Sum of all Networks & breakdown by network: % Chg YTD closed vs. YTD YAG closed

 

Slicer is used to create brand reports

 

I want to use calculation groups in conjuction (as I have lots of other social media metrics - engagements, likes, shares, saves.... already with calculation groups for the % Chg)

 

Formulas used for calculation group for the other social media metrics:

Previous Quarter = CALCULATE(SELECTEDMEASURE(), 'Calendar'[CurQuarterOffset] = -1)
Current Quarter -2 = CALCULATE(SELECTEDMEASURE(), 'Calendar'[CurQuarterOffset] = -2)
% Chg Qtr vs. YAG = DIVIDE(
                            CALCULATE(SELECTEDMEASURE(), 'Dynamic Calculation Group'[Dynamic Periods] = "Previous Quarter") -
                            CALCULATE(SELECTEDMEASURE(), 'Dynamic Calculation Group'[Dynamic Periods] = "Closed Quarter YAG"),
                            CALCULATE(SELECTEDMEASURE(), 'Dynamic Calculation Group'[Dynamic Periods] = "Closed Quarter YAG"))
Previous Month = CALCULATE(SELECTEDMEASURE(), 'Calendar'[CurMonthOffset] = -1)
Ashish_Mathur
Super User
Super User

Hi,

Given this data, my

Ashish_Mathur_0-1725587767002.png

my result is

Ashish_Mathur_1-1725587782429.png

PBI file attached.

Hope this helps.

 

 


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

Not enough sample data.  You need to include the closing balance of the preceding months  (Dec 2023 in this case.)

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.