The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
I'm struggling trying to get my Total correct for my custom Measure in Power BI. I've seen the postings for the solution using SUMX, and I've gotten a lot further, but still stumped. When I'm using the SUMX function, my TOTAL is exactly double what it should be. Here is the code:
Measure 3 =
IF(ISFILTERED('Milestone'[ID]),
IF(NOT(ISBLANK(CALCULATE(MAX('Milestone'[Estimated Date])))),
IF(SELECTEDVALUE('Milestone'[Non Recurring]) = "Yes", 1, 2)
),
SUMX(
VALUES('Milestone'),
IF('Milestone'[Non Recurring] = "Yes", 1, 2)
)
)
The top portion of the ISFILTERED statement works fine for each of the individual items. However the TOTAL is always double.
Any help is greatly appreciated!
EDIT
I should mention that this measure is used on the Child table of a Parent/Child relationship on the form. So the list of Milestones is filtered, and correctly displayed in the Child table. Now I'm realizing that when i simplify the SUMX function to just contain
SUMX('Milestone', 1)
I get exactly 2x the number of related Children. So if there are 2 Milestones, the total will be 4. If there are 6 Milestones, the total will be 12. So for some reason, it seems to be iterating over the collection twice?
I'm stumped...
Unfortunately, this is sensitive data and i can't share. I did create a simple sample, but it doesn't exhibit the same issue so i can't reproduce this. Not sure what that means for my dataset. I did add some more details above so let me know if you have any ideas!
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the July 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
109 | |
67 | |
46 | |
41 |
User | Count |
---|---|
186 | |
85 | |
76 | |
74 | |
56 |