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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
LeoST
Frequent Visitor

Summarize / Summarizecolumns doesn't work as expected

Hello all,

I thought my usecase is simple to replicate in a dax measure but apparently it's not.

I've a data model with a simple table and a connected date table. Now I want to use the summarize/summarizecolumns function to calculate something on a month to month basis, This measure (MyMeasure) works fine when I build up a table visual like this (Columns A,B.C are from the main table, "Jahr" and "Monat" are from my date table):

LeoST_0-1689668303776.png

The second measure ("MyMeasure") looks like this:

COUNTX (
        SUMMARIZECOLUMNS (
            MainTable[a],
            MainTable[b],
            MainTable[c],
            DateTable[DateField].[Jahr],
            DateTable[DateField].[Monat]
    ),
    [MyMeasure]
)

But for some reason it doesn't return the same value?

I also tried the summarize funktion with exaclty the same result:

MyMeasure2 = 
COUNTROWS (
    (
        FILTER (
            ADDCOLUMNS (
                SUMMARIZE (
                    NATURALINNERJOIN ( MainTable, DateTable ),
                    MainTable[a],
                    MainTable[b],
                    MainTable[c],
                    DateTable[DateField].[Jahr],
                    DateTable[DateField].[Monat]
                ),
                "Test", CALCULATE ( [MyMeasure])
            ),
            [Test] = 1
        )
    )
)

It still doesn't create the same result. Anything I'm overlooking here? I tried so many different ways but either ended up with  nothing or the result from the screenshot...

Thanks!

2 REPLIES 2
tamerj1
Super User
Super User

Hi @LeoST 

Here is a simpler version of your code. However, you shouldn't use the [Date].[Year] or / [Date].[Month] rather it is a good idea to have real columns in the date table and use them in both the visual and the dax. The Auto Date Hierarchy is not reliable.

MyMeasure2 =
SUMX (
    SUMMARIZE (
        MainTable,
        MainTable[a],
        MainTable[b],
        MainTable[c],
        DateTable[Jahr],
        DateTable[Monat]
    ),
    [MyMeasure]
)

 

LeoST
Frequent Visitor

I think I found the reason for the difference but I don't know why it's not working correctly: It matches if I remove the page filter I set. It appears the MyMeasure2 does not considner the pagefilter at all? Why is that the case?

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors