The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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):
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!
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]
)
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?
User | Count |
---|---|
25 | |
10 | |
8 | |
6 | |
6 |
User | Count |
---|---|
31 | |
12 | |
10 | |
10 | |
9 |