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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
mriveraa
Regular Visitor

Change table based on slicer alternative

Hello Everyone,

 

Supposed I have the following data: 

mriveraa_0-1682524042005.png

Now I want to compute the difference of the module.name and module.version based on a selection of two versions and show it to another table.  

 

For Example

If I have selected version 100 and 102 

mriveraa_1-1682524248957.png

Then I expect to get a table showing their difference 

mriveraa_2-1682524279898.png

Now I tried to have a calculate table with the Dax Expression

Difference = EXCEPT(
SELECTCOLUMNS(CALCULATETABLE(Module,FILTER(Module,Module[Document.version]=[SlicerTable2])),
"name",Module[Document.modules.name],"version",Module[Document.modules.version]),
 
SELECTCOLUMNS(CALCULATETABLE(Module,FILTER(Module,Module[Document.version]=[SlicerTable1])),"name",Module[Document.modules.name],"version",Module[Document.modules.version]))
 
But it didn't work because from what I saw in the forums calculated columns or tables are not dynamic and cannot be changed to slicer values during runtime. 
 
Is there an alternative way to do this to have the difference be shown during runtime selection? 
 
Thanks in advanced,
Mark

 

 

 

 

 

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @mriveraa ,

 

As far as I know, Power BI doesn't support calculated table/column be dynamic based on slicer or filter. I suggest you to create measures to achieve your goal.

Data model:

vrzhoumsft_0-1682672174856.png

SlcierTable1 = VALUES('Module'[Document.version])
SlcierTable2 = VALUES('Module'[Document.version])
DimModuleName = VALUES(Module[Document.modules.name])

Measure:

Difference = 
VAR _SELECT1 =
    SELECTEDVALUE ( SlcierTable1[Document.version] )
VAR _SELECT2 =
    SELECTEDVALUE ( SlcierTable2[Document.version] )
VAR _VIRTUAL_TABLE =
    EXCEPT (
        SELECTCOLUMNS (
            CALCULATETABLE (
                Module,
                FILTER ( Module, Module[Document.version] = _SELECT2 )
            ),
            "name", Module[Document.modules.name],
            "version", Module[Document.modules.version]
        ),
        SELECTCOLUMNS (
            CALCULATETABLE (
                Module,
                FILTER ( Module, Module[Document.version] = _SELECT1 )
            ),
            "name", Module[Document.modules.name],
            "version", Module[Document.modules.version]
        )
    )
RETURN
    MAXX (
        FILTER ( _VIRTUAL_TABLE, [name] = MAX ( DimModuleName[Document.modules.name] ) ),
        [version]
    )

Result is as below.

vrzhoumsft_1-1682672230476.png

 

Best Regards,

Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @mriveraa ,

 

As far as I know, Power BI doesn't support calculated table/column be dynamic based on slicer or filter. I suggest you to create measures to achieve your goal.

Data model:

vrzhoumsft_0-1682672174856.png

SlcierTable1 = VALUES('Module'[Document.version])
SlcierTable2 = VALUES('Module'[Document.version])
DimModuleName = VALUES(Module[Document.modules.name])

Measure:

Difference = 
VAR _SELECT1 =
    SELECTEDVALUE ( SlcierTable1[Document.version] )
VAR _SELECT2 =
    SELECTEDVALUE ( SlcierTable2[Document.version] )
VAR _VIRTUAL_TABLE =
    EXCEPT (
        SELECTCOLUMNS (
            CALCULATETABLE (
                Module,
                FILTER ( Module, Module[Document.version] = _SELECT2 )
            ),
            "name", Module[Document.modules.name],
            "version", Module[Document.modules.version]
        ),
        SELECTCOLUMNS (
            CALCULATETABLE (
                Module,
                FILTER ( Module, Module[Document.version] = _SELECT1 )
            ),
            "name", Module[Document.modules.name],
            "version", Module[Document.modules.version]
        )
    )
RETURN
    MAXX (
        FILTER ( _VIRTUAL_TABLE, [name] = MAX ( DimModuleName[Document.modules.name] ) ),
        [version]
    )

Result is as below.

vrzhoumsft_1-1682672230476.png

 

Best Regards,

Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.