Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

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

 

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

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.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

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.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi Ashish,

 

Thanks a ton for your help.

 

Thanks,

Dharani

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.