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 Dim table [customer] and 2 fact tables which I cannot append or merge.
Customer | id |
Joe | A |
Jane | B |
Joseph | C |
Fact table 1
Id | Amount |
A | 500 |
B | 400 |
C | 100 |
Fact table 2
Id | Amount |
B | 1000 |
Now I want the measure to Sum the amount of [fact table 2] and (the amount of [fact table 1] Exept for the id`s that are present in the [fact table 2]). So Each id gets only included once. I also want a text for each row indicatin from which fact table the amount is taken.
Result:
Customer | Amount | Origin |
Joe | 50 | Fact table 1 |
Jane | 1000 | Fact table 2 |
Joseph | 100 | Fact table 1 |
Hope you can help me
Solved! Go to Solution.
Hi @BobKoenen
I think it would be best to do this in PQ but see the file attached for a possible solution through measures as requested
Amount_M =
VAR fT2_ = SELECTEDVALUE(FTable2[Amount])
RETURN
IF(ISBLANK(fT2_), SELECTEDVALUE(FTable1[Amount]), fT2_)
Origin_M =
VAR fT2_ = SELECTEDVALUE(FTable2[Amount])
RETURN
IF(ISBLANK(fT2_), "FTable1", "FTable2")
|
Please accept the solution when done and consider giving a thumbs up if posts are helpful. Contact me privately for support with any larger-scale BI needs, tutoring, etc. |
Hi @BobKoenen
I think it would be best to do this in PQ but see the file attached for a possible solution through measures as requested
Amount_M =
VAR fT2_ = SELECTEDVALUE(FTable2[Amount])
RETURN
IF(ISBLANK(fT2_), SELECTEDVALUE(FTable1[Amount]), fT2_)
Origin_M =
VAR fT2_ = SELECTEDVALUE(FTable2[Amount])
RETURN
IF(ISBLANK(fT2_), "FTable1", "FTable2")
|
Please accept the solution when done and consider giving a thumbs up if posts are helpful. Contact me privately for support with any larger-scale BI needs, tutoring, etc. |
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 |
---|---|
49 | |
26 | |
19 | |
15 | |
12 |
User | Count |
---|---|
57 | |
49 | |
43 | |
19 | |
18 |