Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hello Everyone
Hope all are doing fine
Apologies in advance, if it was a simple solution and I couldn't figure out, also I have searched the whole forum but couldn't find an exact solution to my problem.
My data set consists of data as :
only Dec data for 2017,2018,2019
and then March data for 2018,2019,2020
I have some calculations which I want them to fix the current period calculation to whole last period, For example
Page level filters are: Year 2020 and Month March
I want to show current period gross margin
so my formula would be =
Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
You can try a year trailing measure or datesytd as per need
Year behind Sales = CALCULATE([Avg.PricePerUnit],dateadd(Table[Date],-1,Year))
YTD Sales = CALCULATE([Avg.PricePerUnit],DATESYTD((Table[Date]),"12/31"))
This Sales = CALCULATE([Avg.PricePerUnit],DATESYTD((ENDOFYEAR(Table[Date])),"12/31"))
Last YTD Sales = CALCULATE([Avg.PricePerUnit],DATESYTD(dateadd(Table[Date],-1,Year),"12/31"))
Last YTD complete Sales = CALCULATE([Avg.PricePerUnit],DATESYTD(ENDOFYEAR(dateadd(Table[Date],-1,Year)),"12/31"))
Last to last YTD Sales = CALCULATE([Avg.PricePerUnit],DATESYTD(dateadd(Table[Date],-2,Year),"12/31"))
Try this like
avg price per unit % = divide([Avg.PricePerUnit]-[avg price per unit YA],[avg price per unit YA])
Thank You @amitchandak
But for this year sales - I want it to calculate the current period selected like for example If I have a filter of March on page, the calculation should be March sales/March Volume - and that should divide by Dec 2019 Sales/Dec 2019 Volume.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.