Forum Discussion
Daretoexplore
Advocate I
1 year agoActive people
Hey all My client has given me something that I'm not sure is possible, but wanted to check. My data is something like this. CustID. TransDate. Status. Amount 123. 12...
- 1 year ago
Total Spend with Open Status = VAR OpenCustomers = FILTER( SUMMARIZE( Data, Data[CustID], "HasOpen", CALCULATE(MAXX(Data, IF(Data[Status] = "Open", 1, 0))) ), [HasOpen] = 1 ) RETURN CALCULATE( SUM(Data[Amount]), TREATAS(SELECTCOLUMNS(OpenCustomers, "CustID", Data[CustID]), Data[CustID]) ) - 1 year ago
Try
Total for open customers = VAR OpenCustomers = CALCULATETABLE ( VALUES ( 'Table'[Cust ID] ), 'Table'[Status] = "Open" ) VAR Result = SUMX ( OpenCustomers, CALCULATE ( SUM ( 'Table'[Amount] ) ) ) RETURN Result
rajendraongole1
Super User
1 year agoHi Daretoexplore - Yes, it is absolutely possible to calculate this
Create a Measure for "Total Spend with Open Status"
Total Spend with Open Status =
CALCULATE(
SUM('YourTable'[Amount]),
FILTER(
'YourTable',
'YourTable'[CustID] IN
CALCULATETABLE(
VALUES('YourTable'[CustID]),
'YourTable'[Status] = "Open"
)
)
)
This works, please check and confirm