Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hello,
I am trying to calculate YoY % Change for 3 data points: Revenue, Spend, ROAS (Measure) and display in a table.
The current chart is below. I would like to add Revenue YoY % Change, Spend YoY % Change, ROAS YoY % Change.
Attempted using the solution here - https://community.powerbi.com/t5/Desktop/Year-over-Year-calculation/m-p/75403/highlight/true#M31393. However, I believe that failed because this data set is not continuous but by month?
Any help is appreciated!
Thanks!
Data Source:
Current Chart:
@Anonymous,
Firstly, create a date table following the instructions in this blog: https://kohera.be/blog/business-intelligence/how-to-create-a-date-table-in-power-bi-in-2-simple-steps/.
Secondly, create relationship using StartMonth field and Date field between two tables.
Thirdly, create the following measures in your current table.
SumRevenue = SUM(Table2[Revenue])
LastYearRevenue = CALCULATE([SumRevenue],DATEADD('Date'[Date],-1,YEAR))
YOYRevenue = ([SumRevenue]-[LastYearRevenue])/[LastYearRevenue]
SumSpend = SUM(Table2[Spend])
LastYearSpend = CALCULATE([SumSpend],DATEADD('Date'[Date],-1,YEAR))
YOYSpend = ([SumSpend]-[LastYearSpend])/[LastYearSpend]
In addition, we need to know the DAX formula you use to create ROAS.
Regards,
Hello,
Thanks for the response.
I created the Date Table per instructions in the link you provided. Used this formula:
Date =
ADDCOLUMNS (
CALENDAR(DATE(2000,1,1), DATE(2025,12,31)),
"DateAsInteger", FORMAT([Date], "YYYYMMDD"),
"Year", YEAR ([Date]),
"Monthnumber", FORMAT([Date], "MM"),
"YearMonthnumber", FORMAT([DATE], "YYYY/MM"),
"YearMonthShort", FORMAT([DATE], "YYYY/mmm"),
"MonthNameShort", FORMAT([DATE], "mmm"),
"MonthNameLong", FORMAT ([Date], "mmmm"),
"DayOfWeekNumber", WEEKDAY ([Date],2),
"DayOfWeek", FORMAT ([Date], "dddd"),
"DayOfWeekShort", FORMAT ([Date], "ddd"),
"Quarter", "Q" & FORMAT ([Date], "Q"),
"YearQuarter", FORMAT ([Date], "YYYY") & "/Q" & FORMAT ([Date], "Q"),
"StartOfMonth", FORMAT ([Date], "YYYY/MM/1")
)
However, in the YoY Table I need to create a relationship for, the date is First Of Month. Example: 6/1/17, 6/1/17, 5/1/16, etc.
When I tried to create a relationship between the two tables (YoY and Date) it did not work since it is Many to Many.
Do you know how I would change the Date table code above to only have the Start of Month? This way the relationship could be Many to One.
Thanks in advance for your help!
@Anonymous,
Would you mind sharing me the PBIX file? In your scenario, as long as you don't have duplicated values in Date field of Date table, you are able to create relationship using First Of Month field and Date field.
Regards,
Lydia Zhang
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
118 | |
79 | |
47 | |
45 | |
32 |
User | Count |
---|---|
172 | |
90 | |
66 | |
46 | |
45 |