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.
Situation:
I have a fact table that has some unique rows of data that I need to isolate and integrate into some of my other equations.
The dataset is batch based and the batches contain multiple lines. Rows of data that I need to aggregate can only be identified by one of the lines of the batch, which is not one of the lines I need to aggregate.
My Solution:
I was able to solve the problem by creating a calculated dimension table like so:
Calculatetable(values(ftable[BatchID]), ftable[Issue] = "My problem", ftable[code] = "1")
I then created a calculated column using an if statement to match the transactions in the fact table to the dimension table and if they matched, then it was "match" otherwise "no match"
If(ftable[Batch #] = Related(Dimension[Batch #]), "Match", "No Match")
I then added the sum of those with the match to my measure:
Total = Calculate([Total 1], Filter(ftable, fGL[Criteria1] = 1)) + Calculate([Total 2], Filter(ftable, ftable[match] = "Match"))
This seemed to work... but I really want to do this in less steps and maybe one measure?
I was thinking of :
Calculate([Total 1], Filter(ftable, fGL[Criteria1] = 1)) + Calculate([Total 2], Filter(ftable, ftable[Batch #] IN {Calculatetable(values(ftable[BatchID]), ftable[Issue] = "My problem", ftable[code] = "1")})))
But that did not work
I also tried:
Calculate([Total 2], Filter(ftable, ftable[Batch #] IN Filter(values(ftable[BatchID]),ftable[Issue] = "My problem"&& ftable[code] = "1"))))
Does anyone have any different ideas?
Hi @stufico,
Could you mark the proper answer as a solution please?
Best Regards,
Dale
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 |
---|---|
110 | |
99 | |
80 | |
64 | |
57 |
User | Count |
---|---|
145 | |
110 | |
91 | |
84 | |
66 |