Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

Tableau to Power Bi

Hi All,

 

Can someone help me to convert tableau calculation to power bi dax calculation

 

MPR Year Category Group = if
[MPR Year Category] = '2000' OR
[MPR Year Category] = '2001' OR
[MPR Year Category] = '2002' OR
[MPR Year Category] = '2003' OR
[MPR Year Category] = '2004' OR
[MPR Year Category] = '2005' OR
[MPR Year Category] = '2006' OR
[MPR Year Category] = 'pre-2006' OR
[MPR Year Category] = '2007' OR
[MPR Year Category] = '2008' OR
[MPR Year Category] = '2009' OR
[MPR Year Category] = '2010' OR
[MPR Year Category] = '2011' OR
[MPR Year Category] = '2012' THEN 'Legacy-Pre2013'
ELSEIF
[MPR Year Category] = 'Proposal' OR
[MPR Year Category] = '0' OR
ISNULL([MPR Year Category]) THEN 'WIP'
else [MPR Year Category]
END

2 Replies

  • Mohammad_Refaei's avatar
    Mohammad_Refaei
    Icon for Solution Specialist rankSolution Specialist

    Try this:

    MPR Year Category Group =
    SWITCH (
        TRUE (),
        [MPR Year Category]
            IN {
            "2000",
            "2001",
            "2002",
            "2003",
            "2004",
            "2005",
            "2006",
            "pre-2006",
            "2007",
            "2008",
            "2009",
            "2010",
            "2011",
            "2012"
        }, "Legacy-Pre2013",
        [MPR Year Category] IN { "Proposal", "0", BLANK () }, "WIP",
        [MPR Year Category]
    )
    • Anonymous's avatar
      Anonymous
      Not applicable

      MPR Year Category  is direct column