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
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
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.