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

Issues using summarize in a measure

Hello all,

 

I have quite a complicated measure which isn't working as I'd expect.

 

Firstly, I'm creating a summary table in the measure. This table calculates a running average of the values I have in an existing table.

It does this by creating a  new column which is an average of the value on that row and the values following. I have tested the summarize calculation in a calculated column and this works very well.

 

However, when I put the same calculation in a measure and ask the measure to report (for example) the maximum value of the running average, things break down.

If I use the measure in a table to restrict the input then the measure value stays exactly the same -- no matter what filters I apply.

Is the summarize function limited to create a 'static' summary table? How can I get the measure to work.

I'm able to supply code if needed but thought I'd ask this general question first.

 

Thanks,

 

Wiredchop

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

I wrote this article to solve a very similar sounding issue, get the MAX/MIN of an AVERAGE. Let me know if this works and if not, post your code:

 

https://community.powerbi.com/t5/Community-Blog/Design-Pattern-Groups-and-Super-Groups/ba-p/138149

 


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

I wrote this article to solve a very similar sounding issue, get the MAX/MIN of an AVERAGE. Let me know if this works and if not, post your code:

 

https://community.powerbi.com/t5/Community-Blog/Design-Pattern-Groups-and-Super-Groups/ba-p/138149

 


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

Fantastic,

fixed my formula by using maxx(summarize(...),...)  rather than calculate(max(...),summarize(...))

Is there an important reason why to use maxx in this situation?

 

Thanks for your help,

 

Wiredchop

Well, essentially the "X" verssions of those are effectively doing a kind of table scan that evaluates the expression for each row and returns the largest or smallest numeric value out of the scan of those rows.

 

https://technet.microsoft.com/en-us/library/ee634576(v=sql.105).aspx

 


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