Forum Discussion

Gaurav51478's avatar
Gaurav51478
Frequent Visitor
4 years ago
Solved

Tableau for to Dax

Hello Everyone   I am doing tableau migration to Power BI, So i am converting one single form from tableau code to dax   Tableau Formula: (COUNTD(IF ([Sales Type]="AS" AND [Type]="Subs") THEN [O...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Gaurav51478 ,

    Please have a try.

    Column =
    VAR _COUNTD =
        CALCULATE (
            DISTINCTCOUNT ( 'TABLENAME'[ORD_NBR] ),
            FILTER (
                'TABLENAME',
                'TABLENAME'[Type] = "Subs"
                    && 'TABLENAME'[SALES_TYPE] = "APOS"
            )
        )
    VAR RESULT =
        CALCULATE (
            SUM ( 'TABLENAME'[QTY] ),
            FILTER (
                'TABLENAME',
                'TABLENAME'[Type] = "Subs" & 'TABLENAME'[SALES_TYPE] = "POS"
            )
        )
    RETURN
        _COUNT + RESULT
    

    If I have misunderstood your meaning, please provide your pbix file without privacy information and your desired output.

     

    Best Regards

    Community Support Team _ Polly

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.