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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Anonymous
Not applicable

Dynamic Measure based on Month selected

I have two measure values.  One specific for January and other for rest of the months.  If Jan is selcted then display Jan value else display other value.  Can this be done using an switch?

 

Final Term:=
SWITCH(
TRUE(),
VALUES('Forecast Calendar'[Month Short Name])="Jan",[January Terms],
[Terms Non-Blank]
)

 

1 ACCEPTED SOLUTION
Sean
Community Champion
Community Champion

Well yes it can although I probably would not use SWITCH for only 1 condition but rather if there are multiple conditions

Final Term =
SWITCH (
    VALUES ( 'Forecast Calendar'[Month Short Name] ),
    "Jan", [January Terms],
    [Terms Non-Blank]
)

I probably would go with this since there's only 1 IF Statement

Final Term =
IF (
    SELECTEDVALUE ( 'Forecast Calendar'[Month Short Name] ) = "Jan",
    [January Terms],
    [Terms Non-Blank]
)

However they should both work! Smiley Happy

View solution in original post

2 REPLIES 2
Sean
Community Champion
Community Champion

Well yes it can although I probably would not use SWITCH for only 1 condition but rather if there are multiple conditions

Final Term =
SWITCH (
    VALUES ( 'Forecast Calendar'[Month Short Name] ),
    "Jan", [January Terms],
    [Terms Non-Blank]
)

I probably would go with this since there's only 1 IF Statement

Final Term =
IF (
    SELECTEDVALUE ( 'Forecast Calendar'[Month Short Name] ) = "Jan",
    [January Terms],
    [Terms Non-Blank]
)

However they should both work! Smiley Happy

Anonymous
Not applicable

Doesn't like the syntax for 'SELECTEDVALUE'.   The SWITCH works just for Jan but when I select Feb, it displays 0 instead of the feb terminations.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

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

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.