Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
powerbihelp87
Helper III
Helper III

Help Calculating Average QOQ% Change for Year or more

having trouble figuring out if I can get an average of a QOQ% MEasure I created?  the first table shows how my data is set up.

my QOQ % calculations are working fine

QtrItemwaste (is a measure)QOQ% (also dynamic measure)
1123410 
156712 
1891019 
1112131420 
212341110%
2567120%
289102321%
211213149-55%
312342-82%
35675-58%
3891064178%
3112131424167%
41234321500%
456753960%
48910640%
4112131464167%

 

I want to achieve the table below with Average % change of the QOQ%, i also dont want any filter apply to the dates so its just a running change as we keep adding years or additional quarters.

ItemAverage change (no filters should apply always) 
1234476%average change between all quarters (so adding 3 quarters QOQ% divide by 4)
567300% 
891066.30% 
112131493% 

 

 

-----------------------

FYI The original request was to find the trend but didnt think this was easy in PBI so instead just calculating the "average change" instead of linest function from excel

 
1 ACCEPTED SOLUTION
TomMartens
Super User
Super User

Hey @powerbihelp87 ,

 

I guess this measure provides what you are looking for:

Measure = 
AVERAGEX(
    ADDCOLUMNS(
        CROSSJOIN(
            VALUES('Table'[Item])
            , ALL('Table'[Qtr])
        )
        , "_measure " , [QOQ% (also dynamic measure)]
    )
    , [_measure ]
)

It allows to create these table visuals:

image.png

Hopefully, this provides what you are looking for.

 

Regards,

Tom

 

stay safe, stay healthy, and Power On



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

5 REPLIES 5
TomMartens
Super User
Super User

Hey @powerbihelp87 ,

 

I guess this measure provides what you are looking for:

Measure = 
AVERAGEX(
    ADDCOLUMNS(
        CROSSJOIN(
            VALUES('Table'[Item])
            , ALL('Table'[Qtr])
        )
        , "_measure " , [QOQ% (also dynamic measure)]
    )
    , [_measure ]
)

It allows to create these table visuals:

image.png

Hopefully, this provides what you are looking for.

 

Regards,

Tom

 

stay safe, stay healthy, and Power On



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

@TomMartens  Amazing!! It worked perfectly thank you so much 😁

amitchandak
Super User
Super User

You can get last qtr by using last qtr no like


Last Qtr waste = calculate([waste ], filter(Table,Table[Qtr] <=max(Table[Qtr])-1))

but better if you have qtr year column like this(YYYYQQ) and create a rank
Rank = Rankx(all(Table),Table[Qtr])
Last Qtr waste = calculate([waste ], filter(Table,Table[Rank] <=max(Table[Rank])-1))

 

 

My advice would be to Qtr to a different table as all will remove other filters

Refer how to use Rank for prior - https://www.dropbox.com/s/d9898a48e76wmvl/sales_analytics_weekWise.pbix?dl=0

 

If you have date, then use date calendar and Time intelligence

QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(('Date'[Date])))

Last QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(dateadd('Date'[Date],-1,QUARTER)))
Last complete QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD( ENDOFQUARTER(dateadd('Date'[Date],-1,QUARTER))))

Last to last QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(dateadd('Date'[Date],-2,QUARTER)))
Next QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(dateadd('Date'[Date],1,QUARTER)))

Last year same QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(dateadd('Date'[Date],-1,Year)))
Last year same QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(ENDOFQUARTER(dateadd('Date'[Date],-1,Year))))

trailing QTR = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,QUARTER))
trailing  4 QTR = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-4,QUARTER))

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

just noticed the second half didnt populate when I first viewed it! I will try and see how it works out thank you!

@amitchandak  Thank you for looking into my issue! 

 

I am able to get the QOQ% but want the average for all quarters, not sure if that is possible.

 

so lets say item 1234

q1- 10% QOQ

q2-23% QOQ

q3-10% QOQ

 

calculation is (10+23+10)/3

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.