Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Rank for three different columns

Hi BI Experts,

 

Need help here to get solution of "Rank based on Serial No, Cycle Count & Fault Type" & "Rank based on serial No, Log Date and Fault Type". With calculated column(DAX) or Power Query is fine.

 

 

Rank based on Serial No, Cycle Count & Fault Type = Count of distinct Cycles when similar fault Type Occur

Rank based on serial No, Log Date and Fault Type = Count of distinct last different log Date when similar fault type logged

 

Fault TypeSerial NoCycle CountLog DateRank based on Serial No, Cycle Count & Fault TypeRank based on Serial No, Log Date & Fault Type
BentS1256210-Aug-2111
Ink FailureS1256410-Sep-2111
Self StrippingS1256831-Dec-2111
BentS1256831-Dec-2122
Ink FailureS12561023-Feb-2222
BentS12561023-Feb-2233
Broken WeldS12561023-Feb-2211
Self StrippingS12561023-Feb-2222
Broken WeldS12561026-Feb-2212
Ink FailureS12561026-Feb-2223
Self StrippingS12561026-Feb-2223
BentS12561026-Feb-2234
Not PaintedS12561026-Feb-2211
Ink FailureS12561026-Feb-2223
BentS12561320-Apr-2245
Require StrippingS12561325-Apr-2211
Not PaintedS12561325-Apr-2222
Ink FailureM083117-Jan-2211
Ink FailureM083117-Jan-2211
BentM083117-Jan-2211
BentM083117-Jan-2211
Not PaintedM083117-Jan-2211
Not PaintedM083117-Jan-2211
Ink FailureM08333-Mar-2222
Ink FailureA863111-Oct-2111
Broken WeldA863111-Oct-2111
Self StrippingA863111-Oct-2111
Ink FailureA863114-Oct-2112
BentA863114-Oct-2111
Ink FailureA863114-Oct-2112

 

 

 

Thanks,

Dharani

 

  • Hi,

    Write these calculated column formulas

    Rank based on Serial No, Cycle Count & Fault Type = CALCULATE(DISTINCTCOUNT(data[Cycle Count]),FILTER(data,data[Serial No]=EARLIER(data[Serial No])&&data[Fault Type]=EARLIER(data[Fault Type])&&data[Log Date]<=EARLIER(data[Log Date])))
    Rank based on Serial No, Log Date & Fault Type = CALCULATE(DISTINCTCOUNT(data[Log Date]),FILTER(data,data[Serial No]=EARLIER(data[Serial No])&&data[Fault Type]=EARLIER(data[Fault Type])&&data[Log Date]<=EARLIER(data[Log Date])))

    Hope this helps.

3 Replies

  • Hi,

    Write these calculated column formulas

    Rank based on Serial No, Cycle Count & Fault Type = CALCULATE(DISTINCTCOUNT(data[Cycle Count]),FILTER(data,data[Serial No]=EARLIER(data[Serial No])&&data[Fault Type]=EARLIER(data[Fault Type])&&data[Log Date]<=EARLIER(data[Log Date])))
    Rank based on Serial No, Log Date & Fault Type = CALCULATE(DISTINCTCOUNT(data[Log Date]),FILTER(data,data[Serial No]=EARLIER(data[Serial No])&&data[Fault Type]=EARLIER(data[Fault Type])&&data[Log Date]<=EARLIER(data[Log Date])))

    Hope this helps.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Ashish,

       

      Thanks a ton for your help.

       

      Thanks,

      Dharani