Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Good morning,
I am trying to develop a YoY view. I am currently utilizing the following formula:
Previous Year Calls = calculate (distinctcount('Database 1'[Incident Number]), dateadd('Calendar Table'[Date].[date],-1,year))
Here is how the visual appears:
When I use this code:
Solved! Go to Solution.
Hi @MichaelB_MO ,
You want to calculate the growth rate of each year compared to the previous year, right? Here's an example of how I've used the sample data to help you.
We first create a YEAR column so that we can do a better calculation, then we sum each year separately and do a year-over-year growth rate calculation.
Current Year Calls =
CALCULATE(DISTINCTCOUNT('Table'[Incident Number]),ALLEXCEPT('Table','Table'[Year]))
Previous Year Calls =
CALCULATE(
DISTINCTCOUNT('Table'[Incident Number]),
FILTER(
ALL('Table'),
'Table'[Year] = MAX('Table'[Year]) - 1
)
)
YoY Growth Rate =
VAR CurrentCalls = [Current Year Calls]
VAR PreviousCalls =[Previous Year Calls]
RETURN
IF(
NOT(ISBLANK(CurrentCalls)) && NOT(ISBLANK(PreviousCalls)),
DIVIDE(CurrentCalls - PreviousCalls, PreviousCalls, 0),
BLANK()
)
If you have further questions, you can check my pbix file or feel free to reply to me, I will get back to you as soon as I hear from you, I would be honored if my solution solves your problem!
Hope it helps!
Best regards,
Community Support Team_ Tom Shen
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Hi @MichaelB_MO ,
You want to calculate the growth rate of each year compared to the previous year, right? Here's an example of how I've used the sample data to help you.
We first create a YEAR column so that we can do a better calculation, then we sum each year separately and do a year-over-year growth rate calculation.
Current Year Calls =
CALCULATE(DISTINCTCOUNT('Table'[Incident Number]),ALLEXCEPT('Table','Table'[Year]))
Previous Year Calls =
CALCULATE(
DISTINCTCOUNT('Table'[Incident Number]),
FILTER(
ALL('Table'),
'Table'[Year] = MAX('Table'[Year]) - 1
)
)
YoY Growth Rate =
VAR CurrentCalls = [Current Year Calls]
VAR PreviousCalls =[Previous Year Calls]
RETURN
IF(
NOT(ISBLANK(CurrentCalls)) && NOT(ISBLANK(PreviousCalls)),
DIVIDE(CurrentCalls - PreviousCalls, PreviousCalls, 0),
BLANK()
)
If you have further questions, you can check my pbix file or feel free to reply to me, I will get back to you as soon as I hear from you, I would be honored if my solution solves your problem!
Hope it helps!
Best regards,
Community Support Team_ Tom Shen
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
hi @MichaelB_MO ,
this can be achieved with calculation groups.
Once you create the TY and LY calculation items, add the "Fiscal/ calendar year" in the columns of the matrix.
this should provide the intended result. for reference: Dynamic YTD Metric in Power BI Using Field Parameters and Calculation Groups
if this doesn't resolve the issue, kindly provide a sample input and output masking sensitive information in a usable format ( excel, csv, link to pbix etc.)
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
94 | |
86 | |
82 | |
70 | |
49 |
User | Count |
---|---|
143 | |
123 | |
107 | |
61 | |
55 |