Forum Discussion
YoY Comparison without date
- 1 year ago
We can solve this very easily, it is enough to create a calculate column in your fact table with the first date of each quarter, this column will be of type date (it will automatically get Date/Time Data type in Tabular, but you can convert it in Power BI Desktop (not on Power Query, it will not be visible there) to Date.
Calculated column name and code:
First Quarter Date =
VAR _Year = INT ("20"&RIGHT(YourFactQuarterColumn, 2))VAR _MonthNr =
VAR _QuarterNr = LEFT ( YourFactQuarterColumn, 2)
RETURN
IF (
QuarterNr = 1, 1,
IF (
QuarterNr = 2, 4,
IF (
QuarterNr = 3, 7,
10
)
RETURN
DATE ( _Year, _MonthNr, 1 )If this helped, please consider giving kudos and mark as a solution
me in replies or I'll lose your thread
Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page
Consider voting this Power BI idea
Francesco Bergamaschi
MBA, M.Eng, M.Econ, Professor of BI
Hi FabioB7,
Thank you for reaching out to the Microsoft Fabric Forum Community, and special thanks to FBergamaschi for prompt and helpful response.
Just following up to see if the response provided by community member were helpful in addressing the issue.
If one of the responses helped resolve your query, please consider marking it as the Accepted Solution. Feel free to reach out if you need any further clarification or assistance.
Best regards,
Prasanna Kumar