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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
INJAINP
Frequent Visitor

If with Filter

Hello Folks,

 

I have a requirement as follows :

 

there are 3 values in slicer. Suppose the are A , B and C. If A gets selected then a measure value corresponding to A should be displayed and similarly with B and C. but if none of them gets slecteed then va;lue should be 20% of A + 60% of B + 20% of C this should be displayed.

 

any idea how can this be achieved? I tried using if else with filter but it says multiple columns used and does not give correct formula.

 

Thanks

 

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

@INJAINP,

 

You may refer to the DAX below.

Measure =
VAR s =
    SELECTEDVALUE ( Table1[Column1] )
RETURN
    IF (
        ISBLANK ( s ),
        SUMX (
            VALUES ( Table1[Column1] ),
            CALCULATE (
                SWITCH ( SELECTEDVALUE ( Table1[Column1] ), "A", 0.2, "B", 0.6, "C", 0.2 )
                    * SUM ( Table1[Column2] )
            )
        ),
        SUM ( Table1[Column2] )
    )
Community Support Team _ Sam Zha
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-chuncz-msft
Community Support
Community Support

@INJAINP,

 

You may refer to the DAX below.

Measure =
VAR s =
    SELECTEDVALUE ( Table1[Column1] )
RETURN
    IF (
        ISBLANK ( s ),
        SUMX (
            VALUES ( Table1[Column1] ),
            CALCULATE (
                SWITCH ( SELECTEDVALUE ( Table1[Column1] ), "A", 0.2, "B", 0.6, "C", 0.2 )
                    * SUM ( Table1[Column2] )
            )
        ),
        SUM ( Table1[Column2] )
    )
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
LivioLanzo
Solution Sage
Solution Sage

Hi @INJAINP could be done but we need to see your tables

 


 


Did I answer your question correctly? Mark my answer as a solution!


Proud to be a Datanaut!  

luxpbi
Helper V
Helper V

Please, provide samplea data to help you better.

 

Regards,

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.