Forum Discussion
SUM DAX Query on condition
Hi insandur ,
I have created a simple sample, please refer to it to see if it helps you.
Create 2 measures.
Measure =
CALCULATE (
SUM ( 'Table'[Backlog] ),
FILTER (
ALL ( 'Table' ),
'Table'[Shipment] = SELECTEDVALUE ( 'Table'[Shipment] )
)
)
Measure2 =
VAR _maxdate =
MAXX ( ALL ( 'Table' ), 'Table'[Date] )
RETURN
CALCULATE (
SUM ( 'Table'[Backlog] ),
FILTER ( ALL ( 'Table' ), 'Table'[Date] = _maxdate )
)
If I have misunderstood your meaning, please provide more details with your desired output.
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- insandur3 years ago
Helper II
Hi Polly,
Thanks for the solution, Backlog in my table is actually a meausre not a column so i am not able to get the correct ans.
- Anonymous3 years agoNot applicable
Hi insandur ,
I have modified the answer. Please refer to it to see if it helps you.
Measure = SUMX(FILTER(ALL('Table'),'Table'[Shipment]=SELECTEDVALUE('Table'[Shipment])),[Mbacklog])Measure2 = VAR _maxdate = MAXX ( ALL ( 'Table' ), 'Table'[Date] ) RETURN SUMX( FILTER ( ALL ( 'Table' ), 'Table'[Date] = _maxdate ) ,[Mbacklog])The [Mbacklog] is also a measure.
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- insandur3 years ago
Helper II
Thanks again, But i dont get the desired ans😐 Please see the screenshots