Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
1001
Resolver II
Resolver II

I Don't Understand a DAX Component.

Hi, I have this DAX SUMMARIZE statement but I don't understand what the final component of it is telling me (in bold) [ABS Diff].

 

Gross Variance = SUMX(SUMMARIZE('Group Mapping','Group Mapping'[Group2],"ABS Diff",ABS(SUM('Orders'[Ordered])-SUM('Deliveries'[Delivered]))),[ABS Diff])

 

Thanks.

1 ACCEPTED SOLUTION

Abs Diff inside SUMMARIZE is a virtual column. Outside that, it is a virtual column being aggregated.  You cannot output a column as is in a measure - it should always return a scalar value ( min, max, sum, average, fist text string, last text string, earliest date, latest date, etc. ), not multiple rows.










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


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

3 REPLIES 3
danextian
Super User
Super User

Hi @1001 

Gross Variance =
SUMX (
    SUMMARIZE (
        'Group Mapping',
        'Group Mapping'[Group2],
        "ABS Diff", ABS ( SUM ( 'Orders'[Ordered] ) - SUM ( 'Deliveries'[Delivered] ) )
    ),
    [ABS Diff]
)

 

Hi @1001 ,

X functions are iterator functions. They iterate over a table or a virtual table (an expression that returns a table). What is wrapped in SUMMARIZE function is a virtual table with a column called ABS Diff for each distinct item in Group2. SUMX now then sums up ABS Diff. If there are two distinct Group2 items based on the current filter context wherein item1 is 5 and item2 is 7, SUMX returns 12.










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


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

I think the final ABS Diff is outputting my calculation as a column. Is that correct? 

1001_0-1691117889195.png

 

Abs Diff inside SUMMARIZE is a virtual column. Outside that, it is a virtual column being aggregated.  You cannot output a column as is in a measure - it should always return a scalar value ( min, max, sum, average, fist text string, last text string, earliest date, latest date, etc. ), not multiple rows.










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


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.