We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Dear all,
Could you please kindly help with the querry to subtract 1 column from another table.
I have "table 1" with Column "No" Like the one below:
| No |
| A1 |
| A2 |
| A1 |
| A2 |
| A3 |
| A4 |
| A5 |
I have "Table 2" with Column "No_deleted" as following:
| No_deleted |
| A1 |
| A4 |
How can I subtract Column "No" from table 1 to column "No_deleted" in table 2, and putting the result like following:
| No | Result |
| A1 | 0 |
| A2 | A2 |
| A1 | 0 |
| A2 | A2 |
| A3 | A3 |
| A4 | 0 |
| A5 | A5 |
Thank you very much for your help.
Best regards,
Solved! Go to Solution.
Hi, @MightyRabbit
try to use calculate and all with IF and NOT DAX func
the code will be something like
Result =
CALCULATE(
IF(
NOT(CONTAINS(table2, table2[No_deleted], table1[No])),
table1[No],
"0"
),
ALL(table2)
)
Proud to be a Super User!
Hi, @MightyRabbit
try to use calculate and all with IF and NOT DAX func
the code will be something like
Result =
CALCULATE(
IF(
NOT(CONTAINS(table2, table2[No_deleted], table1[No])),
table1[No],
"0"
),
ALL(table2)
)
Proud to be a Super User!
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 |
|---|---|
| 6 | |
| 4 | |
| 3 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 11 | |
| 10 | |
| 7 | |
| 7 | |
| 6 |