Forum Discussion

dogt1225's avatar
dogt1225
Helper III
3 years ago

Convert Tableau Fixed Calculation to PowerBI DAX

I have a data set that contains a list of quizes and and question responses. Example dataset below. I am looking to calcuate the total quizes where Question1 = 5 or 4.

Note that there may be a Quiz with the same [Quiz Number], but different [Question1] response. 

Quiz NumberQuestion1Top 2 Response
123451
456741
456720
678930
432110



The Tableau calculation leverages "Fixed", would like to convert this to PowerBI DAX. Any ideas?


Top 2 Response =
{FIXED [Quiz Number]:
MAX(IF [Question1] = 5 THEN 1
ELSE IF [Question1] = 4 THEN 1
ELSE 0
END)}


2 Replies