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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
AkashShetty
New Member

Stuck in MoM% change due to Monthyear slicer effects

I am unable to view my YoY% and MoM% in the matrix with monthyear slicer(showing 0 values), the values are working fine with year slicer but i need it to work for each month as well. Please help with the same

YoY % Growth (Brand) =
VAR PYsales = CALCULATE(
    SUM('Non F&B'[Sales]),
    SAMEPERIODLASTYEAR('Non F&B'[Date].[Date])
)
VAR CYsales = SUM('Non F&B'[Sales])
RETURN
(IFERROR((CYsales-PYsales)/PYsales,BLANK()))

This is the syntax i am using for YoY change and i am using quick measure for MoM change
Please suggest some solutions, thanks in advance

 

6 REPLIES 6
v-mdharahman
Community Support
Community Support

Hi @AkashShetty,

Thanks for reaching out to the Microsoft fabric community forum.

It looks like you are trying to calculate Year-over-Year (YoY%) and Month-over-Month (MoM%) growth metrics for sales in a Power BI matrix visual. As @Poojara_D12 and @bhanu_gautam already responded to your query, kindly go through their responses and check if your issue can be resolved.

 

I would also take a moment to thank @Poojara_D12 and @bhanu_gautam, for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference.

 

If I misunderstand your needs or you still have problems on it, please feel free to let us know.  

Best Regards,
Hammad.
Community Support Team

 

If this post helps then please mark it as a solution, so that other members find it more quickly.

Thank you.

Hi @AkashShetty,

As we haven’t heard back from you, so just following up to our previous message. I'd like to confirm if you've successfully resolved this issue or if you need further help.

If yes, you are welcome to share your workaround and mark it as a solution so that other users can benefit as well. If you find a reply particularly helpful to you, you can also mark it as a solution.


If so, it would be really helpful for the community if you could mark the answer that helped you the most. If you're still looking for guidance, feel free to give us an update, we’re here for you!

Hi,
I couldn't find the solution I was looking for, as a workaorund I am using both year and month slicers for accuracy which is long but works well. Thank you for all the help

Poojara_D12
Super User
Super User

Hi @AkashShetty 

The reason your YoY% and MoM% measures show zero values when using a MonthYear slicer is that time intelligence functions like SAMEPERIODLASTYEAR and DATEADD require a continuous date column to work correctly, rather than a text or formatted MonthYear field. If your slicer is based on a formatted MonthYear string (like "Jan 2025"), Power BI cannot properly interpret the date sequence, causing these calculations to return blank or zero. To fix this, you should use a dedicated Date table marked as a Date Table in Power BI, which contains a continuous date column. Then, instead of filtering by the MonthYear text field, use the actual Date column from this Date table in your slicer, configured to show months. Adjust your YoY and MoM measures to reference this Date table’s Date column in their time intelligence functions. This approach ensures the calculations respect the proper date sequence, allowing your YoY% and MoM% to display correctly at monthly granularity.

 

YoY % Growth (Brand) =
VAR CYSales =
    CALCULATE(SUM('Non F&B'[Sales]))
VAR PYSales =
    CALCULATE(
        SUM('Non F&B'[Sales]),
        SAMEPERIODLASTYEAR('DateTable'[Date]) -- use your date table
    )
RETURN
    DIVIDE(CYSales - PYSales, PYSales)

 

MoM % Growth =
VAR CYSales = SUM('Non F&B'[Sales])
VAR PmSales = CALCULATE(
    SUM('Non F&B'[Sales]),
    DATEADD('DateTable'[Date], -1, MONTH)
)
RETURN
    DIVIDE(CYSales - PmSales, PmSales)

 

 

 

Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a "Kudos"

Kind Regards,
Poojara - Proud to be a Super User
Data Analyst | MSBI Developer | Power BI Consultant
Consider Subscribing my YouTube for Beginners/Advance Concepts: https://youtube.com/@biconcepts?si=04iw9SYI2HN80HKS
bhanu_gautam
Super User
Super User

@AkashShetty , Try using

DAX
YoY % Growth (Brand) =
VAR CurrentMonthYear = MAX('Non F&B'[Date])
VAR PreviousYearMonth = EDATE(CurrentMonthYear, -12)
VAR PYsales = CALCULATE(
SUM('Non F&B'[Sales]),
'Non F&B'[Date] = PreviousYearMonth
)
VAR CYsales = SUM('Non F&B'[Sales])
RETURN
IFERROR((CYsales - PYsales) / PYsales, BLANK())

 

And 

DAX
MoM % Growth (Brand) =
VAR CurrentMonth = MAX('Non F&B'[Date])
VAR PreviousMonth = EDATE(CurrentMonth, -1)
VAR PMsales = CALCULATE(
SUM('Non F&B'[Sales]),
'Non F&B'[Date] = PreviousMonth
)
VAR CMsales = SUM('Non F&B'[Sales])
RETURN
IFERROR((CMsales - PMsales) / PMsales, BLANK())




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Thank you, but still not working

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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