Forum Discussion
Anonymous
7 years agoNot applicable
Label each sales with different date ranges
Hello My business define each sales by "date_order" and "date_delivery". Therefore, I have a Sales_Table. and a Label_Table The aim is to label the Sales_Table. Here is the expect...
- 7 years ago
Hi Anonymous
You may refer to below measure and drag it for sales table.
Measure = CALCULATE ( MAX ( Label[Label] ), FILTER ( GENERATE ( Sales, Label ), Sales[Order date] >= Label[OrderDate_start] && Sales[Order date] <= Label[OrderDate_end] && Sales[Delivery date] >= Label[Delivery date_start] && Sales[Delivery date] <= Label[Delivery date_end] ) )Regards,
Cherie
Anonymous
7 years agoNot applicable
Thanks a lot v-cherch-msft , your solution is perfect as a measure.
Have you got a similar formula to convert this measure in column ?
I tried to use addcolums without success :(
Anonymous
7 years agoNot applicable
I created a table inspired from your formula.
TableJoin = SELECTCOLUMNS(
FILTER(
CROSSJOIN(Label;'Order');
[Order date] >= Label[OrderDate _ start].[Date]
&& [Order date] <= Label[OrderDate_end].[Date]
&& [Delivery date] >= Label[DeliveryDate_start].[Date]
&& [Delivery date] <= Label[DeliveryDate_end].[Date]);
"OrderID"; [OrderID];"Label" ; Label[Label] )