Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Tableau to DAX

{ FIXED [ALANA] :COUNTD(IF [Resident - Show/Hide] THEN [Student Id] END)} + { FIXED [ALANA] :COUNTD(IF [Resident - Show/Hide] = FALSE THEN [Student Id] END)}

 

 

IF [Compute By] = '1' THEN COUNTD([Student Id]) ELSE NULL END

 

 

CASE [Compute By]

WHEN '1' THEN [% Across]

WHEN '2' THEN [% Down]

END

 

 

Please help me convert above Tableau calculated fields in DAX.

 

Thanks!

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Anonymous ,

     

    Are these three formulas?

    There's no countd() function in dax, you may consider to use distinctcount().

    IF() function in DAX is like below:

    IF( [Compute By] = '1' , DISTINCTCOUNT([Student Id]) , blank())

     

    Switch() function:

    Swtich([Compute By],
          '1' , [% Across]
          '2' , [% Down]
    )

     

    I'm not good at Tableau, please consider to share some sample data and expected result if you need further help.

     

    Best Regards,

    Jay

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    Are these three formulas?

    There's no countd() function in dax, you may consider to use distinctcount().

    IF() function in DAX is like below:

    IF( [Compute By] = '1' , DISTINCTCOUNT([Student Id]) , blank())

     

    Switch() function:

    Swtich([Compute By],
          '1' , [% Across]
          '2' , [% Down]
    )

     

    I'm not good at Tableau, please consider to share some sample data and expected result if you need further help.

     

    Best Regards,

    Jay