Forum Discussion
alialsayer
Helper I
5 years agoDAX measurement for two dates in same table and using filter
I have one table and I have a condition to calculate To calculate order by US $ with: delivered condition is Yes any order date equal or greater than the selected date ( 7th of Jule) any s...
- 5 years ago
Hi alialsayer
if
use measure like bellow:
measure1 = VAR _seldate=SELECTEDVALUE('calendar'[Date]) RETURN CALCULATE(Sum('Table'[US]), FILTER('Table',('Table'[Order Date] >=_seldate || 'Table'[Shipped Date] >=_seldate ) && 'Table'[Deliver] = "Yes"))if
then
measure1 = VAR _seldate=SELECTEDVALUE('calendar'[Date]) RETURN CALCULATE(Sum('Table'[US]), FILTER('Table',('Table'[Order Date] >=_seldate && 'Table'[Shipped Date] >=_seldate ) && 'Table'[Deliver] = "Yes"))-
measure2 = VAR _seldate=SELECTEDVALUE('calendar'[Date]) RETURN CALCULATE(Sum('Table'[US]), FILTER('Table','Table'[Shipped Date] >=_seldate && 'Table'[Deliver] = "Yes"))-
result:
Best Regards,
Community Support Team _ Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
v-xiaotang
Community Support
5 years agoHi alialsayer
if
use measure like bellow:
measure1 =
VAR _seldate=SELECTEDVALUE('calendar'[Date])
RETURN
CALCULATE(Sum('Table'[US]), FILTER('Table',('Table'[Order Date] >=_seldate || 'Table'[Shipped Date] >=_seldate ) && 'Table'[Deliver] = "Yes"))
if
then
measure1 =
VAR _seldate=SELECTEDVALUE('calendar'[Date])
RETURN
CALCULATE(Sum('Table'[US]), FILTER('Table',('Table'[Order Date] >=_seldate && 'Table'[Shipped Date] >=_seldate ) && 'Table'[Deliver] = "Yes"))
-
measure2 =
VAR _seldate=SELECTEDVALUE('calendar'[Date])
RETURN
CALCULATE(Sum('Table'[US]), FILTER('Table','Table'[Shipped Date] >=_seldate && 'Table'[Deliver] = "Yes"))
-
result:
Best Regards,
Community Support Team _ Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
alialsayer
Helper I
5 years agoThanks, it works with me, I really appreciate your help and your attached example make this easy to understand 🌹