Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello,
I have encountered an issue with a calculated column in Power BI. I have two tables, each containing a "CombinedKey" column formed by concatenating five specific columns. I've successfully created similar calculated columns before, which yield the expected results. However, this particular calculated column is producing the opposite results. Instead of giving out "False" it is giving "True" for all the values in both the tables.
Combined Key:
Calculated Column:
Missing_Size =
Var CombKeyTable1 = VALUES(Table1[CombinedKey1])
VAR CombKeyTable2 = VALUES(Table2[CombinedKey2])
RETURN
IF(
COUNTROWS(
EXCEPT(
CombKeyTable1, CombKeyTable2)) > 0,
"True", -- True, stating ComKeyTable1 has a new value which is not present in CombKeyTable2
"False")
I suspect the issue may stem from the concatenation process or the comparison of these concatenated keys across the two tables. To troubleshoot, I extracted the "CombinedKey" values from both tables and compared them in Excel for any discrepancies such as whitespace or formatting issues. Surprisingly, they matched perfectly in Excel.
Could anyone please advise on how I can effectively approach and resolve this discrepancy in Power BI
Thank you!
Solved! Go to Solution.
Hi @achuri,
Per my test, I could not reproduce your issue by following your steps.
To troubleshoot your issue, please create a new calculated column to check if we can output values that are not the same between CombinedKey1 and CombinedKey2 (if any):
outputdifference =
Var CombKeyTable1 = VALUES(Table1[CombinedKey1])
VAR CombKeyTable2 = VALUES(Table2[CombinedKey2])
RETURN
EXCEPT(
CombKeyTable1, CombKeyTable2)
Also, make sure that Power BI Desktop is up to date and also create a new report to check if the issue still exists.
I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best regards,
Joyce
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @achuri,
Per my test, I could not reproduce your issue by following your steps.
To troubleshoot your issue, please create a new calculated column to check if we can output values that are not the same between CombinedKey1 and CombinedKey2 (if any):
outputdifference =
Var CombKeyTable1 = VALUES(Table1[CombinedKey1])
VAR CombKeyTable2 = VALUES(Table2[CombinedKey2])
RETURN
EXCEPT(
CombKeyTable1, CombKeyTable2)
Also, make sure that Power BI Desktop is up to date and also create a new report to check if the issue still exists.
I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best regards,
Joyce
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you so much!! This approach was helpful. This helped me debug my issue and find the root cause of it.
Basically my Table1 holds mulitple values of Combined Key and Table2 was like a master data, so only unique values of Combined Key. My aim was to find missing or new Combined values from table 1 which are not present in Table 2.
More like a VLOOKUP function but in DAX, so I used Filter function along with Count Rows function and it works.
But thanks to you for helping me debug and guiding me with regards to the outputdifference table, that helped me understand my problem and tell me what I was missing!
User | Count |
---|---|
25 | |
12 | |
8 | |
6 | |
6 |
User | Count |
---|---|
26 | |
12 | |
12 | |
10 | |
6 |