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! Request now

Reply
Anonymous
Not applicable

Displaying the non-tested values of a parameter based on some filters parameters, only in DAX

Hello,

I have a DataSource composed of 6 tables : Cart, AllApplesValues, AllOrangesValues, AllIsBioValues, AllNbWormsInsideValues, ParametersValues ( see below )

MrZimo0_4-1654853258844.png

 

The Cart table is composed of data columns ( NbApples and NbOranges ) and filter columns ( IsBio and NbWormsInside ) like I can display the NbApples in a table visual and filter it with IsBio and NbWormsInside. The table looks like this : 

tableau.PNG

 

The AllApplesValues table is composed of a single column containing all the possible values that the NbApples column can have in the Cart table. The AllApplesValues table looks like this : 

MrZimo0_1-1654852432355.png

 

The AllOrangesValues table is composed of a single column containing all the possible values that the NbOranges can have in the Cart table. The AllOrangesValues table looks like this : 

MrZimo0_2-1654852554492.png

 

The table ParametersList is composed of a single column which contains the names of the differents parameters that I want to display in PowerBI. These parameters are the data columns in the Cart table. The ParametersList table looks like this :

MrZimo0_5-1654853310674.png

 

The table AllIsBioValues is composed of a single column which contains all the possibles values of the column IsBio in the Cart table. The AllIsBioValues table looks like this :

MrZimo0_6-1654853464495.png

 

The table AllNbWormsInsideValues is composed of a single column which contains all the possibles values of the column NbWormsInside in the Cart table. The AllNbWormsInsideValues table looks like this :

MrZimo0_7-1654853514406.png

 

 

What I want to do with all these tables is, for example, to show the values of Apples from the table AllApplesValues that are not in the column NbApples in the table Cart and I can filter these data like depending of the selected values of IsBio and NbWormsInside in my report. Here's what it should look like and what I want the result to be : 

MrZimo0_0-1654855630675.png

 

I can switch between NbApples and NbOranges so the content of the table ( the visual ) can change dynamically depending of the chosen paramter and the selected filtered values. I've made some research during a week but I can't find a way to do it

1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi, @Anonymous ;

You could create a flag measure as follow:

flag = 
SWITCH (
    MAX ( 'ParametersList'[Parameters] ),
    "NbApples",
        IF (
            MAX ( 'AllApplesValues'[NbApples] )
                IN SUMMARIZE (
                    FILTER (
                        'cart',
                        [IsBio]
                            IN ALLSELECTED ( 'AllIsBioValues'[IsBio] )
                                && [NbWormsInside] IN ALLSELECTED ( AllNbWormsInsideValues[NbWormsInside] )
                    ),
                    [NbApples]
                ),
            0,
            1
        ),
    "NbOranges",
        IF (
            MAX ( 'AllOrangesValues'[NbOranges] )
                IN SUMMARIZE (
                    FILTER (
                        'cart',
                        [IsBio]
                            IN ALLSELECTED ( 'AllIsBioValues'[IsBio] )
                                && [NbWormsInside] IN ALLSELECTED ( AllNbWormsInsideValues[NbWormsInside] )
                    ),
                    [NbOranges]
                ),
            0,
            1
        )
)

Then apply it into filter.

vyalanwumsft_0-1655087102445.png

The final output is shown below:

vyalanwumsft_1-1655087122740.png


Best Regards,
Community Support Team _ Yalan Wu
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

3 REPLIES 3
v-yalanwu-msft
Community Support
Community Support

Hi, @Anonymous ;

Yes, you could find it.

vyalanwumsft_0-1655776037862.png


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

v-yalanwu-msft
Community Support
Community Support

Hi, @Anonymous ;

You could create a flag measure as follow:

flag = 
SWITCH (
    MAX ( 'ParametersList'[Parameters] ),
    "NbApples",
        IF (
            MAX ( 'AllApplesValues'[NbApples] )
                IN SUMMARIZE (
                    FILTER (
                        'cart',
                        [IsBio]
                            IN ALLSELECTED ( 'AllIsBioValues'[IsBio] )
                                && [NbWormsInside] IN ALLSELECTED ( AllNbWormsInsideValues[NbWormsInside] )
                    ),
                    [NbApples]
                ),
            0,
            1
        ),
    "NbOranges",
        IF (
            MAX ( 'AllOrangesValues'[NbOranges] )
                IN SUMMARIZE (
                    FILTER (
                        'cart',
                        [IsBio]
                            IN ALLSELECTED ( 'AllIsBioValues'[IsBio] )
                                && [NbWormsInside] IN ALLSELECTED ( AllNbWormsInsideValues[NbWormsInside] )
                    ),
                    [NbOranges]
                ),
            0,
            1
        )
)

Then apply it into filter.

vyalanwumsft_0-1655087102445.png

The final output is shown below:

vyalanwumsft_1-1655087122740.png


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

It works very well but is it possible to make sure that if I select NbOranges, the column of the table changes to NbOranges and not NbApples?

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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