Forum Discussion
Limit Matrix Displayed Dates
- Anonymous2 years ago
Hi, FotFly
I demonstrated this solution to you using power bi's financial example dataset.
This could be the problem you're experiencing.
Add the end month column. To put it in the matrix columns.
Measure = Var _Maxselectdate = MAXX(ALLSELECTED('Date'[Date]),'Date'[Date]) Var _lastdate = EOMONTH(_Maxselectdate,-12) VAR _Curmonth = SELECTEDVALUE('financials'[End Month]) Return IF( _Curmonth <= _Maxselectdate && _Curmonth >= _lastdate, 1)Measure Value = Var _Maxselectdate = MAXX(ALLSELECTED('Date'[Date]),'Date'[Date]) VAR _Mindate = EOMONTH(_Maxselectdate,-1) + 1 Var _maxmonthvalue = CALCULATE( SUM(financials[Sales]), 'financials'[Date] >= _Mindate && 'financials'[Date] <= _Maxselectdate) RETURN IF(NOT ISBLANK([Measure]) || ISBLANK(SELECTEDVALUE('financials'[End Month])), IF(ISBLANK(SELECTEDVALUE('financials'[End Month])),_maxmonthvalue,SUM(financials[Sales])))Please see the attached document.
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, FotFly
I demonstrated this solution to you using power bi's financial example dataset.
This could be the problem you're experiencing.
Add the end month column. To put it in the matrix columns.
Measure =
Var _Maxselectdate = MAXX(ALLSELECTED('Date'[Date]),'Date'[Date])
Var _lastdate = EOMONTH(_Maxselectdate,-12)
VAR _Curmonth = SELECTEDVALUE('financials'[End Month])
Return
IF( _Curmonth <= _Maxselectdate && _Curmonth >= _lastdate, 1)
Measure Value =
Var _Maxselectdate = MAXX(ALLSELECTED('Date'[Date]),'Date'[Date])
VAR _Mindate = EOMONTH(_Maxselectdate,-1) + 1
Var _maxmonthvalue = CALCULATE( SUM(financials[Sales]), 'financials'[Date] >= _Mindate && 'financials'[Date] <= _Maxselectdate)
RETURN
IF(NOT ISBLANK([Measure]) || ISBLANK(SELECTEDVALUE('financials'[End Month])), IF(ISBLANK(SELECTEDVALUE('financials'[End Month])),_maxmonthvalue,SUM(financials[Sales])))
Please see the attached document.
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you very much!
I figured that out by adding my filter in the measure I created for the values section instead of adding it as a filter on the visual and it worked.