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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
ldwf
Helper V
Helper V

Showing %Change from Prior Month in a visual when the visual is filtered to show only current month

I have a simple table visual that shows product attributes and a score.  The table is filtered to only show information for the current month, but I need to display a %Change between Current and Prior Month column as well.  I can't get it to work because I filter the visual for the current month, and the results are not correct.  Note that there is no date slicer on the report because the visual must always default to the maximum reporting period, but I need to show %change from prior month.  I created measures using DAX for the Current and Prior months values as: 

Current Month Value=

    VAR a=Calculate(SUMX(TABLE1,TABLE1[Score]),TABLE1[Current Reporting Period Ind="Y")

RETURN a

 

Prior Month Value=

        VAR a=Calculate(

           TABLE1(Score)

          TABLE1(Prior_Reporting_Period_Ind="Y"
)

RETURN a

 

and the MoM% as:

MoM % =
DIVIDE(
    [Score] - [Score-PRIOR Month Value],
    [Score-PRIOR Month Value],
    0
)

When I add te MoM% to the table, the value is always 0.  I'm guessing it is because of the fact that I filter the visual to where the Current Reporting Ind='Y'

1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@ldwf yes you need to define what prior month is, it is actual based on the calendar or indicator, if it is by calendar month, as a best practice, add a date dimension in your model and use it for time intelligence calculations. Once the date dimension is added, mark it as a date table on the table tools. Check the related videos on my YT channel

 

Add Date Dimension
Importance of Date Dimension
Mark date dimension as a date table - why and how?
Time Intelligence Playlist

 



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.

View solution in original post

7 REPLIES 7
cengizhanarslan
Super User
Super User

I assume you do not have proper date table in your scenario, if you had you could simply use PREVIOUSMONTH() for your calculations. Bu tin your case you could try using:

Current Month Value =
CALCULATE (
    SUM ( TABLE1[Score] ),
    TABLE1[Current_Reporting_Period_Ind] = "Y"
)

Prior Month Value =
CALCULATE (
    SUM ( TABLE1[Score] ),
    REMOVEFILTERS ( TABLE1[Current_Reporting_Period_Ind] ),
    TABLE1[Prior_Reporting_Period_Ind] = "Y"
)

MoM % =
DIVIDE (
    [Current Month Value] - [Prior Month Value],
    [Prior Month Value],
    0
)
_________________________________________________________
If this helped, ✓ Mark as Solution | Kudos appreciated
Connect on LinkedIn | Follow on Medium
AI-assisted tools are used solely for wording support. All conclusions are independently reviewed.
Kedar_Pande
Super User
Super User

@ldwf 

 

Current Month Value =
CALCULATE(
SUMX(TABLE1, TABLE1[Score]),
TABLE1[Current Reporting Period Ind] = "Y"
)

Prior Month Value =
CALCULATE(
SUMX(TABLE1, TABLE1[Score]),
TABLE1[Prior Reporting Period Ind] = "Y",
REMOVEFILTERS(TABLE1) 
)

MoM % =
VAR Curr = [Current Month Value]
VAR Prior = [Prior Month Value]
RETURN
DIVIDE(Curr - Prior, Prior, 0)

Drop visual filter pane Current Ind="Y". Measures handle it dynamically.

krishnakanth240
Resident Rockstar
Resident Rockstar

Hi @ldwf 

Can you share sample data of table in text format.

Ashish_Mathur
Super User
Super User

Hi,

Share some data to work with and show the expected result.  Share data in a format that can be pasted in an MS Excel file.


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

@ldwf yes you need to define what prior month is, it is actual based on the calendar or indicator, if it is by calendar month, as a best practice, add a date dimension in your model and use it for time intelligence calculations. Once the date dimension is added, mark it as a date table on the table tools. Check the related videos on my YT channel

 

Add Date Dimension
Importance of Date Dimension
Mark date dimension as a date table - why and how?
Time Intelligence Playlist

 



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.

parry2k
Super User
Super User

@ldwf  try this measure, drop this measure in the visual to check the value it returns, then later you can remove it from the visual

 

Prior Month Value=

        VAR a=Calculate(

           TABLE1(Score)
           ALL ( Table1 ),
          TABLE1(Prior_Reporting_Period_Ind="Y"
)
RETURN a

 



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.

Actually, the Prior_Reporting_Period_Ind should not be used.  I defined it using the actual prior month whether there was a score or not, but many products may not have a value for the actual prior month, i.e, the prior month may be three months ago.  Hence, I should probably define this not using indicators

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.