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.
So I have such modeling. Four tables.
I need to create a measure/column : (Delivery Date - OC shipping date)= date to ship
My biggest question is if no show date in delivery date column then I will use actual delivery date, and do the same thing
(actual Delivery Date- OC shipping date)
My priority is first use DIMDELIVERY TABLE if empty then use DIMACTUALDELIVERY.
How do i write this function ?
Solved! Go to Solution.
Hi @tyan ,
I created some data:
Here are the steps you can follow:
1. Create measure.
Actual Delivery date_measure =
CALCULATE(MAX('Dim Actual Delivery'[Actual Delivery date]),FILTER(ALL('Dim Actual Delivery'),'Dim Actual Delivery'[Group]=MAX('Fact Sales Table'[Group])))
Delivery date_measure =
CALCULATE(MAX('DimDelivery'[Delivery date]),FILTER(ALL('DimDelivery'),'DimDelivery'[Group]=MAX('Fact Sales Table'[Group])))
datediff =
IF(
[Delivery date_measure]=BLANK(),
DATEDIFF(
MAX('Fact Sales Table'[OC Shipping date]),[Actual Delivery date_measure],DAY),
DATEDIFF(
MAX('Fact Sales Table'[OC Shipping date]),[Delivery date_measure],DAY))
2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @tyan ,
I created some data:
Here are the steps you can follow:
1. Create measure.
Actual Delivery date_measure =
CALCULATE(MAX('Dim Actual Delivery'[Actual Delivery date]),FILTER(ALL('Dim Actual Delivery'),'Dim Actual Delivery'[Group]=MAX('Fact Sales Table'[Group])))
Delivery date_measure =
CALCULATE(MAX('DimDelivery'[Delivery date]),FILTER(ALL('DimDelivery'),'DimDelivery'[Group]=MAX('Fact Sales Table'[Group])))
datediff =
IF(
[Delivery date_measure]=BLANK(),
DATEDIFF(
MAX('Fact Sales Table'[OC Shipping date]),[Actual Delivery date_measure],DAY),
DATEDIFF(
MAX('Fact Sales Table'[OC Shipping date]),[Delivery date_measure],DAY))
2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
@tyan , if you have some common field like sales order id
then you try an approach like given in this blog
same in direct query
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
115 | |
100 | |
88 | |
68 | |
61 |
User | Count |
---|---|
150 | |
120 | |
100 | |
87 | |
68 |