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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
riteshgaur
Frequent Visitor

Union two tables based on Slicer

Hi All,

 

I am new to Power BI world.

My requirment is to display a SLICER with Key values which has Year part like Rxxxxx17xxxx, now based on slicer selected value, I have to display data for Rxxxxx17xxxx and Rxxxxx18xxxx (next year) in matrix.

 

So,

- created a slicer

- created one table (Current) which picks Rxxxxx17xxxx 

- created another table (Next) which pick Rxxxxx18xxxx 

These data are perfectly displayed in their individual tables.

 

Now, I need to combine maybe by using UNION, which i tried but it displays all keys. When I do some relationship with either Current or Next, then it displays either records.

How should I achieve my goal, please help?

 

This is code for Combine Table:

 

Table_Combine = DISTINCT(FILTER(UNION(SELECTCOLUMNS(Table_Current, "RiskReference",Table_Current[RiskReference]),SELECTCOLUMNS(Table_Next,"RiskReference",Table_Next[RiskReference])),NOT ISBLANK([RiskReference])))

 

 

Capture.PNG

1 ACCEPTED SOLUTION

Hi riteshgaur ,

 

Do not know your requirement, have you build relationship or add an index column to the two tables? If you have, you may drag columns to chrart directly.

 

Regards,

Jimmy Tao

View solution in original post

3 REPLIES 3
PattemManohar
Community Champion
Community Champion

@riteshgaur Please post the sample data that can be copied




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

Proud to be a PBI Community Champion




Hi Manohar,

 

RiskKey            Amount

RAB17001       100.00

RAB18001       200.00

BUJ17001        239.00

BUJ18001        344.00

 

So, If in Slicer fro RiskKey, RAB17001 is selected, which is for year 2017, report should display RAB17001 and RAB18001 data.

I manage to display them in seperate table but not able to display together.

 

Thanks in advance.

 

RG

  

Hi riteshgaur ,

 

Do not know your requirement, have you build relationship or add an index column to the two tables? If you have, you may drag columns to chrart directly.

 

Regards,

Jimmy Tao

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors