Switch statement: Display measure based on 2 criteria

My advance apologies for not including a .pbix file, as it is currently impractical to prep it for this forum. But if “push comes to shove”, I can come up with a redacted version … :wink: So, I hope my question is generic enough for someone to answer.

Anyway, I want to use a Switch function to determine what (of 2 possible) measures to display – dependent on specific date criteria. If the Fiscal Period offset = 0 (“current month”) AND the Fiscal Month is one of four specific months in the year (Jan, Apr, Jul, or Oct), display Measure A (PQ Actuals). Else, display Measure B (CQ Actuals). I tried Switch, but it’s not letting me use complex criteria — maybe I’m using it wrong.

image

@mdalton2100 ,

Wow - perfect timing! I just posted about this exact issue on LinkedIn earlier this evening.

Here’s the link to the post:

and here’s a video I did a while back explaining this approach in greater detail. I think this will give you exactly what you need to solve this in a straightforward way.

I hope this is helpful.

  • Brian
1 Like

Are you using offset right?
RADACAD as a video on offset - https://www.youtube.com/watch?v=4-hhO5jXPEk

Hello Brian,

Makes total sense!

In trying to implement the solution, the “If” function is not letting me test any given Fiscal Time (the table) column – it only allows me to reference other measures. The only solution (work-around) I believe is to define a supplemental measure based on the Fiscal Month or Fiscal Offset columns, and then reference the supplemental measure within the “IF” statement — awkward. BTW, adding a calculated column is not an option, due to the nature of the source dataset.

image