Forum Discussion
IF Condition
- 4 years ago
Munawar1881 write this calculated column:
Status = VAR _days = ABS(DATEDIFF('Table'[Shipment Date], 'Table'[Actual Shipment Date], DAY)) RETURN SWITCH( TRUE(), 'Table'[Shipment Date] < 'Table'[Actual Shipment Date], "Delay by " & _days & IF(_days = 1, " day", " days"), 'Table'[Shipment Date] > 'Table'[Actual Shipment Date], "Early by " & _days & IF(_days = 1, " day", " days"), "On Time" )
Here is a link to download the file with the solution:
IF Condition 2022-08-02.pbix
In case it answered your question, please accept the solution to help other members find it. Appreciate Your Kudos.
SpartaBI Logo
Visit SpartaBI website Visit SpartaBI Linkdin Visit SpartaBI Facebook
Showcase Report – Contoso By SpartaBI - 4 years ago
Munawar1881 change the code to this:
Status = VAR _days = ABS(DATEDIFF('Table'[Shipment Date], 'Table'[Actual Shipment Date], DAY)) RETURN SWITCH( TRUE(), 'Table'[Actual Shipment Date] = BLANK(), "On Time", 'Table'[Shipment Date] < 'Table'[Actual Shipment Date], "Delay by " & _days & IF(_days = 1, " day", " days"), 'Table'[Shipment Date] > 'Table'[Actual Shipment Date], "Early by " & _days & IF(_days = 1, " day", " days"), "On Time" )
In case it answered your question, please accept the solution to help other members find it. Appreciate Your Kudos.
SpartaBI Logo
Visit SpartaBI website Visit SpartaBI Linkdin Visit SpartaBI Facebook
Showcase Report – Contoso By SpartaBI - 4 years ago
Munawar1881 here is a link to download the file with the solution:
IF Condition 2022-08-02.pbix
my pleasure 🙂
Check out my showcase report - got some high level stuff there. Sure you will find there a lot of cool ideas. Please give it a thumbs up over there if you liked it 🙂
https://community.powerbi.com/t5/Data-Stories-Gallery/SpartaBI-Feat-Contoso-100K/td-p/2449543
If the oder is shipped in shipped date and actual shipment date is empty. normally It should be On Time but it shows delay. please guide me how can I solve it
- SpartaBI4 years ago
Community Champion
Munawar1881 change the code to this:
Status = VAR _days = ABS(DATEDIFF('Table'[Shipment Date], 'Table'[Actual Shipment Date], DAY)) RETURN SWITCH( TRUE(), 'Table'[Actual Shipment Date] = BLANK(), "On Time", 'Table'[Shipment Date] < 'Table'[Actual Shipment Date], "Delay by " & _days & IF(_days = 1, " day", " days"), 'Table'[Shipment Date] > 'Table'[Actual Shipment Date], "Early by " & _days & IF(_days = 1, " day", " days"), "On Time" )
In case it answered your question, please accept the solution to help other members find it. Appreciate Your Kudos.
SpartaBI Logo
Visit SpartaBI website Visit SpartaBI Linkdin Visit SpartaBI Facebook
Showcase Report – Contoso By SpartaBI - Munawar18814 years ago
Helper II
Hi,
Please help me!
If my purchase order quantity is equal to shipped quantity then 100% (Good)performance if purchase order quantity is less then shipped quantity then -% (Poor) Performance if purchase order quantity is higher than shipped quantity then +% (Best) performance.
within the expected shipment date. if date limit exceeds then delay days + PO Quantity = %PerformanceThanks for help!
- SpartaBI4 years ago
Community Champion
Munawar1881 hey can you share maybe a sample data so I could copy paste it to PBIX and also just hard code the result you want to get and show why
- SpartaBI4 years ago
Community Champion
Munawar1881 here is a link to download the file with the solution:
IF Condition 2022-08-02.pbix