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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Heedon
Regular Visitor

How to applying the slicer selected options to UNION tables

I have data set like below

 

raw data =  

lotparametervalue
W101X110
W101X220
W101X330
W101Y112
W101Y229
W101Y339

 

i composed the raw dataset as Data_X and Data_Y appliying the each X-parameter/Y-parameter slicers (with parameter selection)

 

when I choosed the X1 and X2 at X-parameter, 

Data_X was applied filter context of slicer with X1 and X2

lotparametervalue
W101X110
W101X220

 

when I choosed the Y2 and Y3 at Y-parameter, 

Data_Y was applied filter context of slicer with X2 and X3

I have data set like below

 

raw data =  

lotparametervalue
W101X110
W101X220
W101X330
W101Y112
W101Y229
W101Y339

 

i composed the raw dataset as Data_X and Data_Y appliying the each X-parameter/Y-parameter slicers (with parameter selection)

 

when I choosed the X1 and X2 at X-parameter, 

Data_X was applied filter context of slicer with X1 and X2

lotparametervalue
W101y229
W101y329

 

and I wanna get UNION(DATA_X, DATA_Y) but after applying the filter context with X1 and X2 + Y2+Y3 like below.

How to i get below table that applied the results(parameters set, X parameters and Y parameters) users sellect at the X-parameter and Y-parameter slicer.??

 

lotparametervalue
W101y229
W101X110
W101X220
W101y339
9 REPLIES 9
AmiraBedh
Super User
Super User

I created a table to gather the slicers Y and you can do the same for X :

 

SlicerTable_Y = 
DATATABLE(
    "parameter", STRING,
    {
        {"Y1"},
        {"Y2"},
        {"Y3"}
    }
)

 

 

AmiraBedh_0-1723986992447.png

Then you create a calculated table :

 

Data_Y =
CALCULATETABLE(
    raw_data,
    raw_data[parameter] IN VALUES(SlicerTable_Y[parameter])
)

 

 

AmiraBedh_1-1723987047989.png

You do the same thing for X and at the end you combine the result of the 2 calculated tables :

 

Final_Combined_Table =
UNION(Data_X, Data_Y)

 

AmiraBedh_2-1723987329842.png

 

 


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696

@AmiraBedh remember that you shouldn't create calculated columns or calculated tables based on slicer values, filters or measures.  The filter context does not apply to calculated items.

thank you for kind response

 

I checked the filter context do not applying to calculated items... its sad news....


-->parameter list of UNION(DATA_X, DATA_Y) do not changed by selecting the parameters in Slicer_X / Slicer_Y  

is there any other option to solve the problem? 

In your original table why not select X1,X2,Y2 and Y3 ?

i have to design inducing the users just choose multiple X1,X2, X3, X4  and Y1, Y2, Y3 among X1~X100 and Y1~Y200 at slicers.

then I send the selected dataset that applying the X1,X2,X3,X4, Y1,Y2, Y3 to Python visualization using python script (Regression models). 

I just want the final filter contexted table..

Not sure how you get any regression out of these datapoints. Did you mean correlation?

 

Please provide sample data that fully covers your issue.
Please show the expected outcome based on the sample data you provided.

lotparametervalue
W101X11
W102X12
W103X13
W104X14
W101X22
W102X24
W103X26
W104X28
W101Y14
W102Y13
W103Y12
W104Y11
W101Y29
W102Y27
W103Y25
W104Y22
W101X35
W102X36
W103X35
W104X34
W101Y37
W102Y38
W103Y38
W104Y39

 

the raw data is like this (at real data, the X1 ~X100 and the Y1 ~Y100 exists and W101~W199 lots)

 

and if users (customers) choose the X1, X2 and Y2 and Y1

 

then I get linear regression model (X1 and Y2)  and  (X1 and Y1) and (X2 and Y2) and (X2 and Y1)... like this.. 

 

 

 

 

 

 

 

 

 

 

what would be the expected outcome based on the sample data you provided?

Totally agree with you ! Just being lazy to use PQ 😄


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors