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
dogburalHK82
Helper III
Helper III

merge rows using DAX

Hi, 

 

I have purchase order with receipt date and expected date. Now I am trying to evaulate supplier's devliery performace.

 

dogburalHK82_0-1684280750437.png

 

At the end I would like to count as below using DAX, rather than sorting them out in power query using Grouping rows.

How can I merge rows using Dax and extract as below?

dogburalHK82_1-1684280829340.png

Each column definition as below

  • OnTime(any)
    • any delivery arrived before promised date regardless of partial or full amount and quality of part.
    • In this case, PO111, PDN_3 and PDN_2 as well as PDN_1.
    • PO222, PDN_5 and PDN_4

 

  • OnTime
    • any delivery arrived before promised date regardless of partial or full amount - but should be a good part
    • In this case, PO111, PDN_3 and PDN_2 as well as PDN_1
    • PO222, none (because it becomes negative receipt quantity, ended up with backorder qty of 1

 

  • OnTimeInFull
    • any delivery arrived before promised date and in a full amount with correct part
    • In this case, PO111, PDN_2 and PDN_1
    • PO222, none

 

  • Late
    • any delivery arrived after promised date
    • In this case, PO111, PDN_3 (because it was partial deliver and balance arrived after promised date)
    • PO222, PDN_4 and PDN_5

 

  • QualityError
    • any delivery with incorrect (poor) quality part
    • In this case, PO111, none
    • PO222, PDN_4 and PDN_5

 

3 REPLIES 3
dogburalHK82
Helper III
Helper III

not sure how I can acheive using calculated column

@dogburalHK82 check below official Microsoft link. On Step 5 there is example how to use IF function to get some of your status.

https://learn.microsoft.com/en-us/power-bi/transform-model/desktop-tutorial-create-calculated-column... 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!






some_bih
Super User
Super User

Try Calculated column in your table  with IF statement for your wanted status, like INT(Promised Date - Delivery Date. I hope this help.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!






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.

Top Solution Authors