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.
I have a modell which use in DAX Formula TreatAs. However it computes wrong results. I have made a comparison with userelationship. That is working well.
It seems that TreatAs is not evaluating 2 records out of 5.7 Mio.
Please see the Report Tab Error Error "UseRelationship vs TreatAS".
The measure Bilanz is using UseRelationship and works correct
The measure Bilanz TreatAS is using TreatAS and not shows correct Data.
Both measures should display the same amount. It works well for all Accounts except of Account "15400 Baumaschinen". There it seems that TreatAs is not see 2 Records in Table Buchungen. (See Screenshot).
Can you please Debut the DAX Formula engine and see why Bilanz TreatAS is not showing the correct result?
After reviewing the DAX Code and the Data the following code resolved the Problem:
As I said, it's roughly the lack of knowledge about how DAX works that was at fault, not DAX itself. Many people I've been in touch with have claimed that DAX does not work correctly or that it has bugs :))) But the story is always the same. Glad you've been able to squash "the bug" 🙂
What screenshot, errors and tabs are you talking about? There's nothing like that in here... By the way, as is usual with DAX, I'm 100% sure it's your misunderstanding of what DAX is doing is at fault here and not DAX itself.
One DAX Measure is:
Here's a simple example to show you that your measures do not necessarily have to be logically equivalent:
Count With Relationship = COUNTROWS( 'Fact' )
Count With Treatas =
CALCULATE(
COUNTROWS( 'Fact' ),
CROSSFILTER( 'Fact'[Item], Items[Item], None ),
TREATAS(
VALUES( Items[Item] ),
'Fact'[Item]
)
)
To be able to say if anything is really wrong with DAX I need data that demonstrates the issue. Without the data I can't say anything but what I've already said. One thing to note immediately is the fact that in the first formula you are making a connection active (and probably deactivate another one) and in the other no such thing takes place. That means you've got two different situations. I would have to analyze the interplay among all the pieces that make up the code.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
41 | |
20 | |
19 | |
15 | |
15 |
User | Count |
---|---|
47 | |
28 | |
25 | |
17 | |
17 |