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
Anonymous
Not applicable

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
Greg_Deckler
Super User
Super User

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

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Thanks both, i eventually figured out my ans below:

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

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

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.