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
JustinDoh1
Post Prodigy
Post Prodigy

Trying to understand Expression (in SUMMARIZE & MINX/MAXX)

I am trying to analyze this DAX code (indicated on the bottom link)

https://community.powerbi.com/t5/Quick-Measures-Gallery/Lookup-Min-Max/m-p/985814#M434

 

JustinDoh1_1-1658017038798.png

I am just not getting what "_Value" is all about.

According to the definition of Summarize, it "creates a summary of the input table grouped by the specified columns."

 

This is definition by Microsoft site:

SUMMARIZE (<table>, <groupBy_columnName>[, <groupBy_columnName>]…[, <name>, <expression>]…)

 

So, I am guessing SUM('Table'[Value]) is a <groupBy_columnName>, and then what does "_Value" do?

 

How do we express Ex1 and Ex2 in SQL?

 

Thanks.

 

1 ACCEPTED SOLUTION
technolog
Super User
Super User

Hi! 

In Ex1 it's the name of created column. In this column calculate SUM( Table[Value] )

In Ex2 it's the same.

[___Value] it's just a created column name.

 

View solution in original post

7 REPLIES 7
JustinDoh1
Post Prodigy
Post Prodigy

@v-shex-msft 

I am trying to follow up on my previous question.

Thanks.

daXtreme
Solution Sage
Solution Sage

@JustinDoh1 

 

By the way, SUMMARIZE should never be used the way it is in your code in measures. There is a famous article by Marco Ruso and Alberto Ferrari on www.sqlbi.com that explains why and what to replace it with.

technolog
Super User
Super User

Hi! 

In Ex1 it's the name of created column. In this column calculate SUM( Table[Value] )

In Ex2 it's the same.

[___Value] it's just a created column name.

 

@technolog 

Thank you for your help.

Just for reference:

Objective of Summarzie: returns summary table for the requested totals over a set of groups.

So, how do we interpret the bottom DAX in English or SQL?

SUMMARIZE(
            'Table',
            [Item],
            "__Value",SUM('Table'[Value])
        )

 It returns [Item] from 'Table' for sum of value?

HI @JustinDoh1,

This formula mean get the Item field and summary values from your table based on the Item group.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

@v-shex-msft Thank you for your reply.

I am not quite understood.

"get the Item field and summary values from your table based on the Item group"

JustinDoh1_0-1658874142536.png

How do we convert this into SQL?

It will be something like this:

SELECT [Item], SUM([Value])

FROM 'Table'

GROUP BY [Item]

 

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.

Top Solution Authors