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
NilR
Post Patron
Post Patron

Filter Pane for Switch Function

Hi, as you see in the pic, the Final Dax measure should be 3 but it is showing 0 in the final measure, What I am doing wrong?

 

Final Dax Measure is look like below:

Points_Earned_Goal = 
VAR vGoalCode = SELECTEDVALUE('Metric Points Table'[Metric Code])

RETURN
SWITCH (
        TRUE(),
            vGoalCode = "M1", [Points_Earned_Goal_M1],
            vGoalCode ="M2", [Points_Earned_Goal_M2],
            vGoalCode ="M3", [Points_Earned_Goal_M3],
            0
    )

 

and [Points_Earned_Goal_M1] measure for Final Measure is below :

Points_Earned_Goal_M1 = 
VAR vGoalName = SELECTEDVALUE('Metric Points Table'[Metric Definition])
VAR vMaxGoal = SELECTEDVALUE('Metric Points Table'[Max])
VAR vTargetGoal = SELECTEDVALUE('Metric Points Table'[Target])
VAR vMinGoal = SELECTEDVALUE('Metric Points Table'[Min])
VAR vBIOMPHA = 
SWITCH (
        TRUE(),
            [BIOM] >= vMaxGoal,  3,
            [BIOM] >= vTargetGoal && [BIOM] <  vMaxGoal,  2,
            [BIOM] >= vMinGoal && [BIOM] < vTargetGoal,  1,
            [BIOM] >=0 && [BIOM] < vMinGoal ,  0,
            0
    )

RETURN
    COALESCE(vBIOM,0)

NilR_1-1687392466242.png

 

 

2 REPLIES 2
amitchandak
Super User
Super User

@NilR , Change this measure like

 

Points_Earned_Goal =
VAR vGoalCode = SELECTEDVALUE('Metric Points Table'[Metric Code])

RETURN
Sumx(values('Metric Points Table'[Metric Code]) ,
SWITCH (
TRUE(),
vGoalCode = "M1", [Points_Earned_Goal_M1],
vGoalCode ="M2", [Points_Earned_Goal_M2],
vGoalCode ="M3", [Points_Earned_Goal_M3],
0
) )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thank you @amitchandak ! still is not working. could this be any other reasons?

 

NilR_0-1687441300341.png

 

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.