Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I have a table that compares current year sales to prior year sales. My data at the back is a simple two column data: Date and Sales
At the front I used the sameperiodlastyear function to creat a measure:
PY Sales = calculate([Total sales],SAMEPERIODLASTYEAR(Sheet1[Date]))
But the table does not display it properly, there is a total below but each month is blank. Any thoughts?
Much appreciate anyone who can help.
Solved! Go to Solution.
Hi @casterchen,
Based on my test, you need to create a calender table firstly and create the one-to-one relationship:
New table:
Table = CALENDARAUTO()
Relationship:
Result:
You could also download the pbix file to have a view.
Regards,
Daniel He
Hi @casterchen,
Could you please tell me if your problem has been solved? If it is, could you please mark the helpful replies as Answered?
Regards,
Daniel He
Hi @casterchen,
Based on my test, you need to create a calender table firstly and create the one-to-one relationship:
New table:
Table = CALENDARAUTO()
Relationship:
Result:
You could also download the pbix file to have a view.
Regards,
Daniel He
Use this one...
YTD = calculate([Total sales], DATESYTD(Sheet1[Date].Date))
PY Sales = calculate([YTD],SAMEPERIODLASTYEAR(Sheet1[Date].Date))
If it is solution for your query, Pls accept as solution... it is helpful to others....
Thanks venug20, but wouldn't this give me YTD value rather than just the monthly value?
I'm travelling and don't have access to the dataset. Will give it a try once I can get my hands onto it.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
99 | |
82 | |
70 | |
61 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |