Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hey guys!
I'm having troubles trying to compare values from two different tables. The situation is the following: I have two tables, "Enhancements" and "Budget", and I need to compare a value that is present on each of these.
Enhancements Table
ID - Cost Status - Cost
01 - Estimated - 100
02 - Estimated - 200
03 - Confirmed - 250
Budget Table
ID - Cost Status - Cost
01 - Planned - 100
01 - Actual - 120
01 - Projection - 100
02 - Planned - 200
02 - Actual - 220
02 - Projection - 200
So, while one table has a single cost, the other table has 3 different cost values.
These tables are connectec through a fact table, like this:
[Budget]N-----1[Fact]1-----[Enhancements]
What I need to do is, create a calculated table that can compare the cost values present on both of these tables, but respecting it's status. So for example:
Compare cost of ID 01 on both tables, where "estimated" status is equal "planned" on the other table, and do the same for the status "confirmed", where it equals "actual" on the other table.
I tried the following:
Compare = LOOKUPVALUE(Compare[Cost];Compare[ID];Budget[ID]; FILTER(Budget;Budget[Status]="Planned"))
It doesn't work though 😕
Can anyone help me with that?
Hi RSCHMIDT,
Create a calculate column on Budget Table using DAX like this:
Compare Cost =
SWITCH (
[Cost status],
"Planned", LOOKUPVALUE (
Enhancements Table[Cost],
Enhancements Table[ID], Budget Table[ID],
Enhancements Table[Cost Status], "Estimated "
),
"actual", LOOKUPVALUE (
Enhancements Table[Cost],
Enhancements Table[ID], Budget Table[ID],
Enhancements Table[Cost Status], "confirmed"
)
)Regards,
Jimmy Tao
Hi @v-yuta-msft
Thanks a lot for the reply!
Your code doesn't seem to be doing anything. What I need to do is, compare the costs on both tables, so I can know which are different and which have the same value, so I can show them and etc.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 48 | |
| 43 | |
| 39 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 68 | |
| 63 | |
| 31 | |
| 30 | |
| 23 |