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
SofiaK
Regular Visitor

Create a visual comparing percentage difference in three months period

Hi, I need to create a visual showing percentage difference of number of companies in different industries in three months period e.i. june/july/august. 

 

But it only shows me two months not three.difference.JPG

 

 

I'm usuing this formula.

 

Percentage Difference =
VAR CurrentMonthCompanies = [Total Companies]
VAR PreviousMonthCompanies =
    CALCULATE(
        [Total Companies],
        DATEADD('Sheet1 (2)'[Date], -1, MONTH)
    )
RETURN
IF(
    NOT(ISBLANK(PreviousMonthCompanies)),  
    DIVIDE(CurrentMonthCompanies - PreviousMonthCompanies, PreviousMonthCompanies, 0) * 100,
    BLANK()
)
1 ACCEPTED SOLUTION
rajendraongole1
Super User
Super User

Hi @SofiaK - Check, your data source contains records for all three months, especially for August. If any month is missing, Power BI might only calculate the difference for the two available months.

slightly you can modify your DAX formula to calculate the three-month trend by specifying the range directly or by creating measures for each of the three months. 

Percentage Difference =
VAR CurrentMonthCompanies = [Total Companies]
VAR PreviousMonthCompanies =
CALCULATE(
[Total Companies],
DATEADD('Sheet1 (2)'[Date], -1, MONTH)
)
VAR PreviousTwoMonthsCompanies =
CALCULATE(
[Total Companies],
DATEADD('Sheet1 (2)'[Date], -2, MONTH)
)
RETURN
IF(
NOT(ISBLANK(PreviousMonthCompanies)) && NOT(ISBLANK(PreviousTwoMonthsCompanies)),
DIVIDE(CurrentMonthCompanies - PreviousMonthCompanies - PreviousTwoMonthsCompanies, PreviousMonthCompanies + PreviousTwoMonthsCompanies, 0) * 100,
BLANK()
)

 

dont forget to to have a Date dimension table, consider creating one. This allows for more accurate date-based calculations and lets you set up a continuous timeline across months.

 

Hope this works.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

1 REPLY 1
rajendraongole1
Super User
Super User

Hi @SofiaK - Check, your data source contains records for all three months, especially for August. If any month is missing, Power BI might only calculate the difference for the two available months.

slightly you can modify your DAX formula to calculate the three-month trend by specifying the range directly or by creating measures for each of the three months. 

Percentage Difference =
VAR CurrentMonthCompanies = [Total Companies]
VAR PreviousMonthCompanies =
CALCULATE(
[Total Companies],
DATEADD('Sheet1 (2)'[Date], -1, MONTH)
)
VAR PreviousTwoMonthsCompanies =
CALCULATE(
[Total Companies],
DATEADD('Sheet1 (2)'[Date], -2, MONTH)
)
RETURN
IF(
NOT(ISBLANK(PreviousMonthCompanies)) && NOT(ISBLANK(PreviousTwoMonthsCompanies)),
DIVIDE(CurrentMonthCompanies - PreviousMonthCompanies - PreviousTwoMonthsCompanies, PreviousMonthCompanies + PreviousTwoMonthsCompanies, 0) * 100,
BLANK()
)

 

dont forget to to have a Date dimension table, consider creating one. This allows for more accurate date-based calculations and lets you set up a continuous timeline across months.

 

Hope this works.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





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!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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.