Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
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
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
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)
@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())
Proud to be a Super User! |
|
Thank you, but still not working
User | Count |
---|---|
16 | |
14 | |
13 | |
12 | |
11 |
User | Count |
---|---|
19 | |
16 | |
15 | |
11 | |
9 |