Forum Discussion
Need to transfer sum case when from SQL to DAX
Hello,
Can you help me to transfer the following statement to power BI from SQL (Google data studio)
Sum(case when CONTAINS_TEXT(Status,"Done") then 1 else 0 end)/sum (case when Status is not null then 1 else 0 end)
Both columns are strings not numbers.
Thanks in advance!
- Anonymous4 years ago
Hi i belive this could be what you are looking for;
Dax =
DIVIDE (
CALCULATE ( COUNTROWS ( 'Table' ), CONTAINSSTRING ( 'Table'[status], "Done" ) ),
CALCULATE ( COUNTROWS ( 'Table' ), 'Table'[status] <> BLANK () ),
BLANK ()
)
2 Replies
- AnonymousNot applicable
Hi i belive this could be what you are looking for;
Dax =
DIVIDE (
CALCULATE ( COUNTROWS ( 'Table' ), CONTAINSSTRING ( 'Table'[status], "Done" ) ),
CALCULATE ( COUNTROWS ( 'Table' ), 'Table'[status] <> BLANK () ),
BLANK ()
) - PetarRogNew Member
Thanks, I was using column instead of measure