Forum Discussion

neto22's avatar
neto22
New Member
4 years ago
Solved

Sum Distinct with condition

Hello guys,

 

Qlik has a language called set analysis, which allows you to create formulas through conditions.

 

SUM({$<[Limit Flg] = {'S'}>}DISTINCT(NUM(CEIL([Last Original Limit]))))))

 

I'm trying to reproduce the same concept in DAX in PBI, but so far I haven't been successful.

 

Can someone help me?

 

Thanks 😄

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi neto22 ,

     

    I try to learn set analysis in Qlik and understand it's calcualte logic by myself. And I think you are trying to sum the [Last Original Limit] with out duplicates (Distinct) with the condition that [Limit Flg] = "S".

    I suggest you to try this code.

    My Sample:

    Measure:

    Convert the code = 
    SUMX (
        SUMMARIZE (
            FILTER ( 'Table', 'Table'[Limit Flg] = "S" ),
            'Table'[Last Original Limit]
        ),
        [Last Original Limit]
    )

    Result is as below.

     

    Best Regards,
    Rico Zhou

     

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

     

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi neto22 ,

     

    I try to learn set analysis in Qlik and understand it's calcualte logic by myself. And I think you are trying to sum the [Last Original Limit] with out duplicates (Distinct) with the condition that [Limit Flg] = "S".

    I suggest you to try this code.

    My Sample:

    Measure:

    Convert the code = 
    SUMX (
        SUMMARIZE (
            FILTER ( 'Table', 'Table'[Limit Flg] = "S" ),
            'Table'[Last Original Limit]
        ),
        [Last Original Limit]
    )

    Result is as below.

     

    Best Regards,
    Rico Zhou

     

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