Forum Discussion
How to get Count from two different table- Un-match Count Table Record with New Table
- 2 months ago
Hi Rakesk13,
Thank you for the screenshot and follow-up question.The error occurs because the DAX was converted into a measure. Measures do not have row context, so Power BI cannot determine a single EMP ID value and returns the "A single value for column cannot be determined" error.
In this scenario, use a calculated column instead of a measure. Create a column that first identifies unmatched EMP IDs and then uses LOOKUPVALUE (or RELATED if a relationship exists) to return the matching EMP NAME from EMP_ADD. After that, filter the visual to show only rows where the returned value is not blank. This will return the expected records E, BB, and FF.Create this column in Sheet1 (2):
Matched_Name = VAR IsUnmatched = NOT ( 'Sheet1 (2)'[EMP ID] IN VALUES ( 'EMP Details'[EMP ID_DE] ) ) RETURN IF ( IsUnmatched, LOOKUPVALUE ( EMP_ADD[EMP NAME], EMP_ADD[EMP NAME], 'Sheet1 (2)'[EMP NAME] ), BLANK() )Then add:
Show_Record = IF ( NOT ISBLANK ( 'Sheet1 (2)'[Matched_Name] ), 1, 0 )Filter the visual:
Show_Record = 1Hope this helps. If you have any questions regarding this, please feel free to reach out us. We will be happy to help.
Hi Rakesk13,
Try below DAX, Store the table in a variable first and then apply lookupvalue to fetch against those unmatched rows.
Matched_Name =
VAR IsUnmatched =
NOT (
'Sheet1 (2)'[EMP ID]
IN VALUES ( 'EMP Details'[EMP ID_DE] )
)
RETURN
IF (
IsUnmatched,
LOOKUPVALUE (
EMP_ADD[EMP NAME],
EMP_ADD[EMP NAME], 'Sheet1 (2)'[EMP NAME]
)
)
π I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.
π‘ Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.
π As a proud SuperUser and Microsoft Partner, weβre here to empower your data journey and the Power BI Community at large.
π Curious to explore more? [Discover here].
Letβs keep building smarter solutions together!
- Rakesk132 months agoHelper III
Thanks for Quick Response.
But Facing Count issue only record E we are getting, we need E,BB FF record in ours output.
we are looking for below output :
EMP ID
EMP NAME
Age
Amt
Un-Matched Values
5
E
4
2333
#N/A
E
12
BB
13
45
#N/A
BB
15
FF
11
2
#N/A
FF
Please can you help on this .
Thanks & Regards,
Rakesh Jadhav
- grazitti_sapna2 months agoSuper User
Hi Rakesk13,
I can see that you have created a calculated column and not a measure, try creating a measure and then test the values
- Rakesk132 months agoHelper III
Hi,
I have created Measure but getting below error :
Please can you help out on this.
Thanks & Regards,
Rakesh Jadhav