The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hi!
I need to find how many times unique ID occures in table B and C and count how many times this Unique ID appears in table A.
In a card visual I need to display this value. So far I was trying below measure, and couple of different once, but nothhing works. It filters it correctly, but it does not show me the proper value in the Card visual.
Solved! Go to Solution.
@Anonymous
In a card visual, there is no row context to filter the tables, so SELECTEDVALUE or similar row-based filtering won't work properly.
Correct Measure:
Measure =
VAR TableBIDs = DISTINCT('Table B'[Unique_ID])
VAR TableCIDs = DISTINCT('Table C'[Unique_ID])
VAR CombinedIDs = UNION(TableBIDs, TableCIDs)
VAR IDsInA = FILTER(CombinedIDs, NOT(ISBLANK(LOOKUPVALUE('Table A'[Unique_ID], 'Table A'[Unique_ID], [Unique_ID]))))
RETURN
COUNTROWS(IDsInA)
💌 If this helped, a Kudos 👍 or Solution mark would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn
@Anonymous
In a card visual, there is no row context to filter the tables, so SELECTEDVALUE or similar row-based filtering won't work properly.
Correct Measure:
Measure =
VAR TableBIDs = DISTINCT('Table B'[Unique_ID])
VAR TableCIDs = DISTINCT('Table C'[Unique_ID])
VAR CombinedIDs = UNION(TableBIDs, TableCIDs)
VAR IDsInA = FILTER(CombinedIDs, NOT(ISBLANK(LOOKUPVALUE('Table A'[Unique_ID], 'Table A'[Unique_ID], [Unique_ID]))))
RETURN
COUNTROWS(IDsInA)
💌 If this helped, a Kudos 👍 or Solution mark would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn
Hi Kedar,
Thank you, that works ! The only thing which I changed is below, as I wanted to only count distinct values from both columns B and C.
VAR CombinedIDs = DISTINCT(UNION(TableBIDs, TableCIDs))
Thank you!
User | Count |
---|---|
15 | |
13 | |
9 | |
6 | |
6 |
User | Count |
---|---|
28 | |
18 | |
13 | |
9 | |
5 |