Forum Discussion
Anonymous
4 years agoNot applicable
Calculate Function Based on a Date Difference
I have a calculate function that calculates Ordered Volume using a treatas function below that works as intended. I am trying to use that same calculation with an adjusted ship date but am unsure on ...
v-janeyg-msft
Community Support
4 years agoHi, Anonymous
According to your requirement. I think you can create a calculated column first because TREATAS function can't use expression. Then create a column to display results.
You can try:
Dateselect =
IF (
[PlannedGIDate] <= [OrderLineDeliveryDate],
[OrderLineDeliveryDate],
[PlannedGIDate]
)
result=
CALCULATE (
[Ordered Volume],
TREATAS ( VALUES ( 'Calendar'[FiscalDate] ), CustomerOrders[Dateselect] ),
CustomerOrders[OrderItemDeleted] <> TRUE ()
)
Did I answer your question? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.
Best Regards,
Community Support Team _ Janey