Forum Discussion

hemann's avatar
hemann
Icon for Helper I rankHelper I
3 years ago
Solved

DAX Count on condition duplicated

Hi,

I am trying to return serial number using DAX measure based on following condition, it appears in x2 or more sources. 

Sample data

 Source 
Serial NumberABCTotal
12341 12
1235 3 3
12361  1
1237 1 1
123832 5
12391  1
1240  11
12411  1

 

Desired Result

Serial NumberResult
12342
12385

 

Can somebody please help with this. 

  • Hi,

    Try these measures

    Values = SUM(Data[Value])
    Count = COUNTROWS(Data)
    Measure = SUMX(FILTER(VALUES(Data[Source]),CALCULATE([Count],all(Data[Source]))>=2),[Values])

    Hope this helps.

4 Replies

  • Hi hemann ,

     

    Try the following code:

    Count Over 2 = if(COUNT('Table'[A]) + COUNT('Table'[B]) + COUNT('Table'[C]) > 1, SUM('Table'[Total] ))

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi hemann,

    Did the above suggestions help with your scenario? if that is the case, you can consider Kudo or Accept the helpful suggestions to help others who faced similar requirements.

    If these also don't help, please share more detailed information to help us clarify your scenario to test.

    How to Get Your Question Answered Quickly 

    Regards,

    Xiaoxin Sheng

  • Hi,

    Try these measures

    Values = SUM(Data[Value])
    Count = COUNTROWS(Data)
    Measure = SUMX(FILTER(VALUES(Data[Source]),CALCULATE([Count],all(Data[Source]))>=2),[Values])

    Hope this helps.

    • hemann's avatar
      hemann
      Icon for Helper I rankHelper I

      Yes this worked - thanks for your help with it!!