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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
RizwanQureshi
Regular Visitor

dynamic tables based on slicer’s selected values

We have Power BI solution with the Model in Import mode. There is a special requirement to get dynamic tables based on slicer’s selected values. Desired output is union of two dynamic tables as in below diagram. Highlighted is the union.

RizwanQureshi_0-1655099298582.png

Table 1 is the part of Model (in relationship with other tables)

Table 2 is unrelated table.

We tried Below DAX to generate dynamic table. It works fine with hardcoded value but does not recognize values selected from slicer.

 

Following working with hardcoded values

MergeSOV_Periltbl =

VAR SelectedProperty =

    CALCULATETABLE (values(PropertySOV),PropertySOV[PropertyName]

in  {"A","B"})

   

var SelectedPerils=CALCULATETABLE (values(Perils),Perils[PerilName]

          in  {"GLORIA","DAVID"})

 

VAR UnionResult = UNION( SelectedProperty, SelectedPerils)

 

RETURN

    UnionResult

 

Other syntax is

VAR SelectedProperty =CALCULATETABLE (filter(all(Property),CONTAINSROW({"A","B"},Property[PropertyName])))

 

Following Dynamic Values selected from slicer Is not working

MergeSOV_Periltbl =

VAR PropertySlicer = IF(ISFILTERED(Property),  

CONCATENATEX(ALLSELECTED(Property), PropertySOV[PropertyName],","),"(All)")

 

VAR PerilsSlicer = IF(ISFILTERED(Perils),  

CONCATENATEX(ALLSELECTED(Perils), Property[PerilsName],","),"(All)")

 

 

var SelectedProperty =CALCULATETABLE (values(Property),Property[PropertyName]

    in  { PropertySlicer })

 

 

var SelectedPerils =CALCULATETABLE (values(Perils), Perils [PerilName]

          in  { PerilsSlicer })

 

VAR UnionResult = UNION( SelectedProperty, SelectedPerils)

 

RETURN

    UnionResult

 

Please suggest Solution

1 REPLY 1
Anonymous
Not applicable

HI @RizwanQureshi,

Current power bi does not support creating dynamic calculated column/table based on filter/slicer. They are working on the different levels and you can't use the child to affect their parent level.

Notice: the data level of power bi.

Database(external) -> query table(query, custom function, query parameters) -> data model table(table, calculate column/table) -> data view with virtual tables(measure, visual, filter, slicer)

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.