Forum Discussion
Quarter over Quarter analysis Analysis
Want to calcualte Quarter VS Quarter for below data in power bi quarter and year column is not in date format .
6 Replies
- Kishore_KVNSolution Sage
Hello navneet0512 ,
Create one new date column with the help of that year column.
Date Column = DATE('TABLE'[Years],01,01)
Then create new calendar table then create relationship with this date column and calculate Quarter Over Quarter.You can use below calculation for reference.
QoQ Sales Change = VAR CurrentQuarterSales = SUM('YourTable'[Sales]) VAR PreviousQuarterSales = CALCULATE(SUM('YourTable'[Sales]), DATEADD('DateTable'[Date], -1, QUARTER)) RETURN IF(ISBLANK(CurrentQuarterSales) || ISBLANK(PreviousQuarterSales), BLANK(), (CurrentQuarterSales - PreviousQuarterSales) / PreviousQuarterSales)If this post helps, then please consider accepting it as the solution to help other members find it more quickly. Thank You!!
- navneet0512Helper III
After date column creation :- If i am selecting quarter 2009Q2 then in date column it is 01/01/2009
- Kishore_KVNSolution Sage
Got it, create this way then
Date Column =
Switch(True(),
Right(Quarter_Column,1) = 1 , DATE(Year_Column,01,01),
Right(Quarter_Column,1) = 2 , DATE(Year_Column,04,01),Right(Quarter_Column,1) = 3 , DATE(Year_Column,07,01),
Right(Quarter_Column,1) = 4 , DATE(Year_Column,10,01),
BLANK()
)
- navneet0512Helper III
Have a look .
- navneet0512Helper III
Kishore_KVN Can you please help me with above error?