Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
swaggerboy69
Helper IV
Helper IV

Card from 2 separate data

Can you guys help me with my problem?

I have 2 separate data/table with names.

The reason why we have to separate data is because they have a separate line of business.

However, these tables can have the same name input and can repeat.

What I want is a Card that would count all the names. However, the repeating names will only count as 1.

Here's a visualization of the data:

 

Name 1Name 2
NoahJulia
JeraldMonroe
AugustNoah
JeraldChristian
ChristianKurt

 

Given that, I want a card that would show as 7 since other names are repeating.

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@swaggerboy69 

 

Please try below measure

measure3 = 
VAR namelist =
    VALUES ( 'Table'[Name1] )
var namelist2=VALUES('Table (2)'[Name2])
    var newtable= distinct(UNION(namelist,namelist2))
return COUNTROWS(newtable)

1.PNG

Hope this is helpful.

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

3 REPLIES 3
ryan_mayu
Super User
Super User

@swaggerboy69 

 

I am not sure why you deleted your latest update. Maybe it was by mistake.

 

Exclude "Noah"

Measure 2 = 
VAR namelist =
    CALCULATETABLE(VALUES ( 'Table1'[Name 1] ),FILTER(Table1,Table1[Name 1]<>"Noah"))
var namelist2=
    CALCULATETABLE(VALUES('Table2'[Name 2]),FILTER(Table2,Table2[Name 2]<>"Noah"))
var newtable= 
    DISTINCT(UNION(namelist,namelist2))
return COUNTROWS(newtable)

1.PNG

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




amitchandak
Super User
Super User

@swaggerboy69 , Try like

countx(distinct(union(Table[Name 1], Table[Name 2])),[Name 1])

ryan_mayu
Super User
Super User

@swaggerboy69 

 

Please try below measure

measure3 = 
VAR namelist =
    VALUES ( 'Table'[Name1] )
var namelist2=VALUES('Table (2)'[Name2])
    var newtable= distinct(UNION(namelist,namelist2))
return COUNTROWS(newtable)

1.PNG

Hope this is helpful.

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.