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
slukas
Frequent Visitor

Merge column from two tables to create one common slicer

I have two simialar tables that have similar data.  One has a start location, a few other data fields, and an expense amount.  The other has a destination location, a few other data fields, and a different expense amount.  For my presentation I have two charts.  One chart shows the start location expenses.  The other shows the destination expenses.  I am attempting to create a single slicer that filters both locations.  The number of locations is limited.  To solve the problem for the short term I created a new table with the "Enter Data" option and typed in the twenty or so locations in the current data set.  I created a relationship between the entered table and both of my other two tables.  This is not ideal as other locations my pop up.  How can I create my entered "location" table dynamically based on the two data tables?

Steve

1 ACCEPTED SOLUTION
msornakumar
Advocate III
Advocate III

Hi,

 

  A calulate table can be used for the below purpose. Check the below Pseudocode

 

LocationTbl = 
VAR StartLocation =
    SELECTCOLUMNS ( SL, "StartLocation", SL[StartLocation] )
VAR EndLocation =
    SELECTCOLUMNS ( EL, "EndLocation", EL[EndLocation] )
RETURN
    DISTINCT(UNION ( StartLocation, EndLocation ))

View solution in original post

2 REPLIES 2
msornakumar
Advocate III
Advocate III

Hi,

 

  A calulate table can be used for the below purpose. Check the below Pseudocode

 

LocationTbl = 
VAR StartLocation =
    SELECTCOLUMNS ( SL, "StartLocation", SL[StartLocation] )
VAR EndLocation =
    SELECTCOLUMNS ( EL, "EndLocation", EL[EndLocation] )
RETURN
    DISTINCT(UNION ( StartLocation, EndLocation ))

Thanks.  Just what the newbi needed 🙂

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.