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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
TRADER083
Helper I
Helper I

SUMMARIZE giving partial correct result

Hi everyone,

 

I have the following DAX. It's probably not the ideal way of summarizing data but trying to understand why it's not giving the correct results.

1. tem_table is a temp table that filters based on 2 conditions.

2. sum_table1 uses tem_table and group by field1. sum_table1 does not always gives the correct results. Some rows are summed as if no filters were applied, while other rows are summed corrected based on the filter.
3. sum_table2 is a more simple version of what I am trying to achieve and it gives the correct result.

Question: why doesn't sum_table1 behave consistenctly right/wrong?

 

 

 

TEST =
    var tem_table =
                    SELECTCOLUMNS (
                        FILTER (
                            table1,
                            filter1 = "123" && filter2 = "456" --filtering field
                        ),
                        field1, --grouping field
                        "sum1", table1[field2] --summing field
                    )

VAR sum_table1 =
                SUMMARIZE(
                    tem_table,
                    field1,
                    "sum1", sum(table1[field2])
                )

VAR sum_table2 =
                SUMMARIZE(
                    FILTER (
                        table1,
                        filter1 = "123" && filter2 = "456"
                    ),
                    field1,
                    "sum1", sum(table1[field2])
                )

return sum_table1

 

 

 
2 REPLIES 2
Anonymous
Not applicable

Hi @TRADER083 ,

Based on the description, try to modify the dax formula to the following.

TEST =
VAR tem_table =
    SELECTCOLUMNS (
        FILTER (
            table1,
            filter1 = "123" && filter2 = "456"
        ),
        "field1", field1,
        "sum1", table1[field2]
    )

VAR sum_table1 =
    SUMMARIZE(
        tem_table,
        [field1],
        "TotalSum1", SUMX(tem_table, [sum1])
    )

return sum_table1

 

View the summarize dax information.

SUMMARIZE function (DAX) - DAX | Microsoft Learn

 

Best Regards,

Wisdom Wu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

lbendlin
Super User
Super User

sum_table1 is summarizing the field "field2"  which doesn't exist in tem_table as you replaced it with "sum1".

 

But that's only a part of your problem.  Mandatory read:  https://www.sqlbi.com/articles/all-the-secrets-of-summarize/

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors