cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

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%
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User IX
Super User IX

Re: show weekly change average

@qucikq1 - 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>)

 


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

Not link spamming! If I posted a link in reply it is because I did assume you know how to search the web but thought it was the fastest way to fix your issue.

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

3 REPLIES 3
Highlighted
Super User IX
Super User IX

Re: show weekly change average

Highlighted
Super User IX
Super User IX

Re: show weekly change average

@qucikq1 - 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>)

 


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

Not link spamming! If I posted a link in reply it is because I did assume you know how to search the web but thought it was the fastest way to fix your issue.

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

Highlighted
Helper I
Helper I

I Re: show weekly change average

Thanks both, i eventually figured out my ans below:

AVG =
AVERAGEX (
SUMMARIZE (
'mytable',
'mytable'[ID],
'mytable'[% difference vs Last Week]
),
[% difference vs Last Week]
)

Helpful resources

Announcements

August Community Highlights

Check out a full recap of the month!

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power BI

Join us for an in-depth look at the new Power BI features and capabilities at the free Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors