Forum Discussion
Is this possible using DAX
- 6 years ago
Hi Anonymous
Let me know if you'd like to get below results:
Measure 2 = var a = MAX('Table 2'[CloseDate selected]) var b = MIN('Table 2'[CloseDate selected]) var c= MAX('Table 3'[SnapshotDate selected]) var d = MIN('Table 3'[SnapshotDate selected]) var closedateofendsnapshotdate = CALCULATE(MAX('Table'[CloseDate]),FILTER('Table',[SnapshotDate]=c)) var closedateofbeginningsnapshotdate = CALCULATE(MAX('Table'[CloseDate]),FILTER('Table',[SnapshotDate]=d)) Return CALCULATE(SUM('Table'[Amount]),FILTER('Table',closedateofendsnapshotdate>closedateofbeginningsnapshotdate&&closedateofendsnapshotdate>a&&'Table'[CloseDate]=closedateofendsnapshotdate))Measure 3 = SUMX('Table',[Measure 2])
thank you, can you please let me know what Table 2 and Table 3 are?
HI Anonymous
They're calendar tables for bringing the slicer of the snapshot date selected and close date selected, coz we are not able to use the original table's column as a slicer to filter the expected result.
- Anonymous6 years agoNot applicable
The logic is working only when the Deal Id is used in the table. If I want to look at the aggregate value (without Deal Id), it shows blank. Any idea how to modify it to work without Deal ID?
- v-diye-msft6 years agoCommunity Support
Hi Anonymous
Could you please kindly mark my answer as a solution for the original question? That will help others find it more quickly. thanks a lot!
I'll draw it up for your new question at my earlier convenience.
- v-diye-msft6 years agoCommunity Support
Hi Anonymous
Let me know if you'd like to get below results:
Measure 2 = var a = MAX('Table 2'[CloseDate selected]) var b = MIN('Table 2'[CloseDate selected]) var c= MAX('Table 3'[SnapshotDate selected]) var d = MIN('Table 3'[SnapshotDate selected]) var closedateofendsnapshotdate = CALCULATE(MAX('Table'[CloseDate]),FILTER('Table',[SnapshotDate]=c)) var closedateofbeginningsnapshotdate = CALCULATE(MAX('Table'[CloseDate]),FILTER('Table',[SnapshotDate]=d)) Return CALCULATE(SUM('Table'[Amount]),FILTER('Table',closedateofendsnapshotdate>closedateofbeginningsnapshotdate&&closedateofendsnapshotdate>a&&'Table'[CloseDate]=closedateofendsnapshotdate))Measure 3 = SUMX('Table',[Measure 2])