Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

show weekly change average

Source table:

IDDateWeekNumPageview
AJul 27 202031100
AJul 23 202030200
AAug 4 202032300
BJul 23 202030333
BJul 27 202031111
BJul 27 2020 31111

 

Then I created a dynamic table by summarize ():

IDWeekNumWeekly total% difference vs last week
A302000
A31100-50%
A32500400%
B303330
B31222-33.3%
    

 

I was able to use Matrix table to show this, but I now want to use avg weekly % change to display with other chart visual like above, how could I extract the 'weekly% change' per ID?

ID31 % change32 % changetotal (avg)
A-50400175%
B0-33.3%-33.3%

 

i.e. Is there any way to get avg % not using Matrix, and make the 'avg of weekly % change' usage in other chart? 

IDAvg of weekly % change
A175%
B-33.3%
  • Anonymous - Yes, you can do it all dynamically in variables in DAX. For example here: https://community.powerbi.com/t5/Community-Blog/Design-Pattern-Groups-and-Super-Groups/ba-p/138149

    The pattern is:
    MinScoreMeasure = MINX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
    MaxScoreMeasure = MAXX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
    AvgScoreMeasure = AVERAGEX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
    etc.

     

    You can use something like:

     

    VAR __Table = ADDCOLUMNS(SUMMARIZE(....),"% change", <calc goes here>)

     

3 Replies