Forum Discussion
Anonymous
2 years agoNot applicable
Power BI Date Function
i need to create a function that calculates the sales amount for the 68 days in each quarter. for example if i want to see total sales amount for 2021Q1 i will have 31 days May + 30 days June +7...
- 2 years ago
Hi Anonymous
Understood
Can you please create pbix file with sample data and share the pbix file link with access
Anonymous
2 years agoNot applicable
Thanks PijushRoy for the response.. i am not sure if thats the answer i was looking for ...i want to see the Sales amount for 68 days in 2022Q1 vs Sales amount for 68 days in 2023Q1 .. to do a YoY%.
Below what i have created as example to get the amount for 2021Q1 for 68 days (day 1 to day 68)
Col1 = CALCULATE(SUM(Query1[Bkgs]),DATESBETWEEN(Query1[Fiscal Date].[Date],DATE(2021,5,1),DATE(2021,7,7)))
as you can see here the dates are hardcoded hence every time i need to manually change the dates in the code if i need to do it for another dates.
i want the parameter of 68 days to be a FUNCTION which can be used with the existing code.
in case in future i want to see YoY% between 2 years for a sale of 75 days.. i can go to the function and change the date from 68 to 75.
PijushRoy
2 years agoCommunity Champion
Hi Anonymous
Understood
Can you please create pbix file with sample data and share the pbix file link with access