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
jkay27
Helper I
Helper I

Union of two tables with no relation

Hi,

 

Hoping there's a simple explanation to this - I have two tables, one containing two columns: "company" and "basis". The other table contains a single "basis" column. The first table's data is created via the DAX below, and is filtered based on a 1:1 cardinality between Overview and the EAD table (and a slicer). 

 

EAD = SELECTCOLUMNS('Overview',"Company",Overview[Company],"Basis",Overview[Basis])

 

1st table (EAD)

Company1 Basis1

Company2 Basis2

Company 3 Basis3

 

2nd table (Basis List)

Basis 4

Basis 5

Basis 6

 

I would effectively like to select the "basis" column from table 1 and table 2, then union them, but can't figure out a way to ensure I don't lose my filtering in table 1, as table 2 has no relation to table 1 nor the base "overview" table.

 

Desired output

If company1 selected:

 

Basis1

Basis 4

Basis 5

Basis 6

 

Does anyone know how I can achieve this?

 

 

Many thanks

Joel

1 ACCEPTED SOLUTION
v-frfei-msft
Community Support
Community Support

Hi @jkay27,

 

Please check the following steps as below.

 

1. Create a calculated table as below.

 

ba = UNION(VALUES(Basis[Basi]),VALUES(EAD[Basis]))

2. Create a measure and filter the table visual using the measure, just make the measure is 1.

 

Measure = var va = MAX(ba[Basi])
var sele = CALCULATE(MAX(EAD[Basis]),ALLSELECTED(EAD))
var al = VALUES(Basis[Basi])
return
IF(va in al || sele =va ,1,0)

Then we can get the result as below.

 

Capture.PNG

For more details, please check the pbix as attached.

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

4 REPLIES 4
v-frfei-msft
Community Support
Community Support

Hi @jkay27,

 

Please check the following steps as below.

 

1. Create a calculated table as below.

 

ba = UNION(VALUES(Basis[Basi]),VALUES(EAD[Basis]))

2. Create a measure and filter the table visual using the measure, just make the measure is 1.

 

Measure = var va = MAX(ba[Basi])
var sele = CALCULATE(MAX(EAD[Basis]),ALLSELECTED(EAD))
var al = VALUES(Basis[Basi])
return
IF(va in al || sele =va ,1,0)

Then we can get the result as below.

 

Capture.PNG

For more details, please check the pbix as attached.

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

 

 

Hi @jkay27,

 

To create a measure not a calculated column.

 

Measure Found2 = var va = MAX(FINAL[Measure])
var selected = CALCULATE(MAX('Overview'[Measure]),ALLSELECTED('Overview'))
var allMeasures = VALUES('Exit Assumptions'[Measure])
return
IF(va in allMeasures || selected = va ,1,0)

 

2.PNG3.PNG

 

For more details, please check the pbix as attached.

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Great, thanks Frank - didn't realised I'd clicked the wrong button. This works perfectly.

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.