March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello Helpful People,
I have the following dataset
Supplier Name | Material Number | Stat. Delv Date | G/R Date | Performance |
LEONI FIBER OPTICS INC | 222-317500 | 8/5/2022 | 8/26/2022 | Late |
LEONI FIBER OPTICS INC | 030-001000 | 8/5/2022 | 9/19/2022 | Late |
LEONI FIBER OPTICS INC | 030-001100 | 8/8/2022 | 8/1/2022 | Early |
LEONI FIBER OPTICS INC | 460-102800 | 8/12/2022 | 1/1/1901 | Late |
LEONI FIBER OPTICS INC | 460-102400 | 8/15/2022 | 10/21/2022 | Late |
LEONI FIBER OPTICS INC | 460-102400 | 8/24/2022 | 1/1/1901 | Late |
LEONI FIBER OPTICS INC | 030-001000 | 9/6/2022 | 9/26/2022 | Late |
LEONI FIBER OPTICS INC | 030-000900 | 9/6/2022 | 9/19/2022 | Late |
LEONI FIBER OPTICS INC | 222-317900 | 9/9/2022 | 10/12/2022 | Late |
LEONI FIBER OPTICS INC | 460-102800 | 9/22/2022 | 1/1/1901 | Late |
LEONI FIBER OPTICS INC | 460-113801 | 10/3/2022 | 1/1/1901 | Late |
LEONI FIBER OPTICS INC | 030-000900 | 10/5/2022 | 10/12/2022 | Late |
LEONI FIBER OPTICS INC | 030-001000 | 10/5/2022 | 10/3/2022 | Early |
LEONI FIBER OPTICS INC | 030-001100 | 10/14/2022 | 10/12/2022 | Early |
LEONI FIBER OPTICS INC | 222-272500 | 10/17/2022 | 10/24/2022 | Late |
LEONI FIBER OPTICS INC | 222-317500 | 10/20/2022 | 1/1/1901 | Late |
LEONI FIBER OPTICS INC | 222-317900 | 10/21/2022 | 10/18/2022 | Early |
LEONI FIBER OPTICS INC | 030-000800 | 10/24/2022 | 10/24/2022 | Early |
LEONI FIBER OPTICS INC | 222-272100 | 10/26/2022 | 10/24/2022 | Early |
LEONI FIBER OPTICS INC | 222-272100 | 10/26/2022 | 10/24/2022 | Early |
LEONI FIBER OPTICS INC | 222-272200 | 10/26/2022 | 1/1/1901 | Late |
LEONI FIBER OPTICS INC | 222-272200 | 10/26/2022 | 1/1/1901 | Late |
LEONI FIBER OPTICS INC | 460-102400 | 10/27/2022 | 1/1/1901 | Late |
LEONI FIBER OPTICS INC | 460-102400 | 10/31/2022 | 1/1/1901 | Late |
I am trying to create a line plot that shows the percentage of materials that are shipped "Early" each month. I am using the below measure to calculate the %:
Solved! Go to Solution.
Hi @kaylastarr ,
Try adding zeros to the numerator, like this:
On Time Shipments =
VAR _ON_TIME =
CALCULATE (
COUNTROWS ( Suppliers ),
OR ( Suppliers[Performance] = "On Time", Suppliers[Performance] = "Early" ) = TRUE
) + 0
VAR _DELIVERED =
CALCULATE (
COUNTROWS ( Suppliers ),
Suppliers[Performance] <> "Not Delivered Yet"
)
VAR _RESULT = DIVIDE(_ON_TIME,_DELIVERED)
RETURN
_RESULT
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data
Hi @kaylastarr ,
Try adding zeros to the numerator, like this:
On Time Shipments =
VAR _ON_TIME =
CALCULATE (
COUNTROWS ( Suppliers ),
OR ( Suppliers[Performance] = "On Time", Suppliers[Performance] = "Early" ) = TRUE
) + 0
VAR _DELIVERED =
CALCULATE (
COUNTROWS ( Suppliers ),
Suppliers[Performance] <> "Not Delivered Yet"
)
VAR _RESULT = DIVIDE(_ON_TIME,_DELIVERED)
RETURN
_RESULT
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data
This worked! without pulling in unnecessary 0's thank you so much!
Hi @kaylastarr ,
You can add an IF statement to the measure.
Something like this:
On Time Shipments =
VAR CountofNonLateShipments =
CALCULATE (
COUNTROWS ( Suppliers ),
OR ( Suppliers[Performance] = "On Time", Suppliers[Performance] = "Early" ) = TRUE
)
RETURN
IF (
ISBLANK ( CountofNonLateShipments ),
0,
CALCULATE (
COUNTROWS ( Suppliers ),
OR ( Suppliers[Performance] = "On Time", Suppliers[Performance] = "Early" ) = TRUE
)
/ CALCULATE (
COUNTROWS ( Suppliers ),
Suppliers[Performance] <> "Not Delivered Yet"
)
)
Please mark as accepted solution if this has resolved the issue.
I have tried adding the IF statement before and it ends up pulling in ANY material that is on the list as 0 instead of just the ones for that month. But the solution by Gao above works.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
134 | |
91 | |
89 | |
64 | |
58 |
User | Count |
---|---|
201 | |
137 | |
107 | |
72 | |
68 |