Forum Discussion
Power BI Date Function
- 2 years ago
Hi Anonymous
Understood
Can you please create pbix file with sample data and share the pbix file link with access
Hi Anonymous
Hope you have the Date column in the Sales Table and your year starts from May to April
Please calculate the below Calculated column
FiscalYear = VAR _Year = Year("SalesTable'[Date])
VAR _Month = Month("SalesTable'[Date])
RETURN
If(_Month >= 4, _Year+1, _Year)
FiscalQuarter = VAR _Month = Month("SalesTable'[Date])
RETURN
SWITCH(TRUE(),
_Month in {4,5,6},"Q1",
_Month in {7,8,9},"Q2",
_Month in {10,11,12},"Q3",
_Month in {1,2,3},"Q4")
You get the fiscal year & fiscal quarter,
Another calculated column
FiscalYearQuarter = 'SalesTable'[FiscalYear]&'SalesTable'[FiscalQuarter]
Use the field in slicer.
If you have datetable, instead of creating column in salesTable, create the same column in DateTable
If your requirement is solved, please make sure to MARK AS SOLUTION and help other users find the solution quickly. Please hit the LIKE button if this comment helps you.
Thanks
Pijush
www.MyAccountingTricks.com
https://www.youtube.com/MyAccountingTricks