Forum Discussion
eryka_90
Helper I
1 year agoCumulative Value based on condition
Hi All, I want to have cumulative value in my matrix table based on certain condition. Jan 2024 : Posting date < Feb 1st 2024 and clearing date > Jan 31st Feb 2024 : Posting date < Mac 1st 20...
- Anonymous1 year ago
Hi, eryka_90
You can try the following dax to achieve your need.Measure:
Net Due = VAR _netDue = CALCULATE ( COUNTROWS ( 'Table' ), FILTER ( 'Table', MONTH ( 'Table'[Net Due Date] ) - 1 = MONTH ( SELECTEDVALUE ( 'Date'[firstDayofMonth] ) ) ) ) RETURN _netDue 0-15 = CALCULATE ( COUNTROWS ( 'Table' ), FILTER ( 'Table', 'Table'[DaysDiff_1] <= 15 && MONTH ( 'Table'[Net Due Date] ) = MONTH ( SELECTEDVALUE ( 'Date'[firstDayofMonth] ) ) ) ) 16-31 = CALCULATE ( COUNTROWS ( 'Table' ), FILTER ( 'Table', 'Table'[DaysDiff_1] < 31 && 'Table'[DaysDiff_1] > 16 && MONTH ( 'Table'[Net Due Date] ) = MONTH ( SELECTEDVALUE ( 'Date'[firstDayofMonth] ) ) ) ) DaysDiff_1 = VAR _netDueDate = SELECTEDVALUE ( 'Table'[Net Due Date] ) VAR _lastDayofMonth = EOMONTH ( _netDueDate, 0 ) VAR _dayDiff = INT ( _lastDayofMonth - _netDueDate ) RETURN _dayDiff DaysDiff_2 = VAR _netDueDate = SELECTEDVALUE ( 'Table'[Net Due Date] ) VAR _lastDayofMonth = EOMONTH ( _netDueDate, 1 ) VAR _dayDiff = INT ( _lastDayofMonth - _netDueDate ) RETURN _dayDiffBest Regards,
Yang
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
Anonymous
1 year agoNot applicable
Hi, eryka_90
It is possible to see the data you shared normally, but if you can share what you expect the visuals to look like as well as the logic it will help us realize your needs faster, thank you for your understanding. Feel free to help you.
Best Regards,
Yang
Community Support Team