label
2 TopicsQuarterly Growth Calculation
Hello! I'm calculating the average growth rates of some sale values for each quarter. I had to convert the quarters into numeric values to get it to work though. Here is the measure I used: Growth Rate from Average Sales = VAR CurrentQuarter = MAX(Assets[Quarter]) VAR CurrentQuarterSales = CALCULATE(AVERAGE(Assets[Sales]), Assets[Quarter] = CurrentQuarter) VAR PrevQuarter = MAX(Assets[Quarter]) - 1 VAR PreviousQuarterSales = CALCULATE(AVERAGE(Assets[Sales]), Assets[Quarter] = PrevQuarter) RETURN IF(ISBLANK(CurrentQuarterSales) || ISBLANK(PreviousQuarterSales), BLANK(), DIVIDE(CurrentQuarterSales - PreviousQuarterSales, PreviousQuarterSales)) Here is the data: Sales Quarter Qlabel 454 4 Q4 2022 326 4 Q4 2022 542 3 Q3 2022 542 4 Q4 2022 653 3 Q3 2022 553 2 Q2 2022 535 2 Q2 2022 554 2 Q2 2022 553 1 Q1 2022 985 4 Q4 2022 696 4 Q4 2022 662 4 Q4 2022 366 3 Q3 2022 365 1 Q1 2022 665 4 Q4 2022 363 3 Q3 2022 352 1 Q1 2022 233 4 Q4 2022 352 1 Q1 2022 524 2 Q2 2022 235 4 Q4 2022 241 3 Q3 2022 545 1 Q1 2022 658 3 Q3 2022 654 4 Q4 2022 354 3 Q3 2022 365 4 Q4 2022 1000 1 Q1 2022 545 3 Q3 2022 985 2 Q2 2022 654 1 Q1 2022 354 1 Q1 2022 When I turn it into a visualisation it shows the quarter as a number (1 instead of Q1 2022). Is there any way of calculating the growth and then in the visualisation showing the % growth against the quarter as written in the Qlabel column (Q1 2022)? Here is the visualisation currently. the row marked as "4" is the growth from Q3 2022 to Q4 2022.Solved2.2KViews0likes2CommentsHow to create a categorical column based on the quarterly growth of price?
Hi, I have sales data like the following: Date Product Price Sales 2020.04.01 AAA 60 600 2020.05.01 AAA 60 900 2020.09.01 AAA 70 700 I want to get a report based on the price changes: Category Time Total Sales New Sales 2020Q2 1500 Price Increase 2020Q3 700 So far, I'm able to create new measures based on the quarterly price change: VAR __PREV_QUARTER = CALCULATE( AVERAGE('pricing'[price]), DATEADD('pricing'[date].[Date], -1, QUARTER) ) VAR __NEXT_QUARTER = IF(DATEDIFF(LASTDATE(pricing[date].[Date]),TODAY(),QUARTER)>1, CALCULATE( AVERAGE('pricing'[price]), DATEADD('pricing'[date].[Date], 1, QUARTER) ) ,1 ) VAR QuarterChange = AVERAGE('pricing'[price]) - __PREV_QUARTER RETURN IF( __PREV_QUARTER&&__NEXT_QUARTER,IF(QuarterChange>0,"Increase",IF(QuarterChange<0,"Decrease", "No change")), "New win / churn" But the measures cannot be put as Rows header (my speculation is that measures needs the overall input from a table). Can someone suggest what can be done in DAX to categorize the quarterly price change trend? Thanks.764Views0likes1Comment