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.
Hi All,
I have a wierd problem: the result of two measures depend on the order they are applied onto a Matrix visual. Could this be a storage engine bug? If I change the order of the measure after they were applied onto the visual, nothing happens. I have to delete one measure and apply back again for the changes to take effect.
Here are my tables:
Here's the first result:
And here's the second one:
And heres' my DAX:
Article Motive Count =
COUNTROWS ( article_motives )
Aftersales Motives =
VAR PackageSelection2 = {"P6 - Backpack"} --,"P2 - Subpart","P6 - Backpack","P9 - Shoe","P10 - Accessory"}
VAR RelevantPackages2 =
CALCULATETABLE(
article_packages,
packages[name] IN PackageSelection2
)
VAR RelevantMotives2 =
CALCULATETABLE(
VALUES( package_motives[motive_id] ),
RelevantPackages2
)
VAR MotivesNeeded2 =
CALCULATE(
[Article Motive Count],
TREATAS( RelevantMotives2, article_motives[motive_id])
)
RETURN
MotivesNeeded2
Pre-sales Motives =
VAR PackageSelection = {"P1 - Toppart","P2 - Subpart","P6 - Backpack","P9 - Shoe","P10 - Accessory"}
VAR RelevantPackages =
CALCULATETABLE(
article_packages,
packages[name] IN PackageSelection
)
VAR RelevantMotives =
CALCULATETABLE(
VALUES( package_motives[motive_id] ),
RelevantPackages
)
VAR MotivesNeeded =
CALCULATE(
[Article Motive Count],
TREATAS( RelevantMotives, article_motives[motive_id])
)
RETURN
MotivesNeeded
Hi there!
Anyone has any idea why this could happen?
Hi @v-rzhou-msft !
Thanks for the reponse!
To make things a bit more clear here are my steps:
1. Apply 'Aftersales Motives' measure onto the visual. Result: 249 - good result
2. Apply 'Pre-Sales Motives' measure onto the visual. Result: 249 - wrong result
3. Remove the two measures from the visual
4. Apply 'Pre-Sales Motives' measure onto the visual. Result: 1392 - good result
5. Apply 'Aftersales Motives' measure onto the visual. Result: 1392 - wrong result
So basically the measure applied second takes the value of the one applied first. If I change the order in the Visualizations pane, that doesn't change the results, only if I remove the measure that was applied first.
Here's the sample file: https://we.tl/t-XAMvYX6G0c
Best,
Marcrell
Hi @mkinal ,
This should be caused by your data model. Which one is the correct subtotal, first one or second one? Or both of them are incorrect.
Could you share a sample file with me and show the result you want? This will make me easier to find the solution.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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 |
---|---|
112 | |
100 | |
80 | |
64 | |
57 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |