cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

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

Accepted Solutions
Highlighted
Community Champion
Community Champion

Re: Dynamic Measure based on Month selected

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
Highlighted
Community Champion
Community Champion

Re: Dynamic Measure based on Month selected

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

Highlighted
Helper I
Helper I

Re: Dynamic Measure based on Month selected

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
Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Power Platform 2020 release wave 2 plan

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors