Forum Discussion
FILTER by previous available date
- 5 years ago
Solved with the following measure, proposed by Anonymous in another topic
Previous Value =VAR CurrentDate = MAX(cleaned_row_count[Date])VAR ClientID = MAX('table'[id])VAR PreviousDate = CALCULATE(MAX(cleaned_row_count[Date]),ALL('Date'[Date]),ALL(cleaned_row_count[Date]),FILTER('Date',[Date]<CurrentDate))VAR Result = CALCULATE(SUM(cleaned_row_count[Number of Rows]),ALL('Date'[Date]),ALL(cleaned_row_count[Date]),FILTER('Date',[Date]=PreviousDate))RETURN Result
Thank you so much for your answer.
It doesn't work for me. Let me precise a little bit my question. My scheme looks like:
Above in my question I replaced "Number of Rows" by "Sale", sorry.
I created a measure using your patern and get the following:
Nevertheless, my table shows empty values for Last Day Non Continuous.
This will work:
Previous Date rows =
VAR PrevDate =
MAXX (
FILTER (
ALL ( 'Date' ),
'Date'[Date] < MAX ( 'Date'[Date] )
&& NOT ( ISBLANK ( [Number of rows] ) )
),
'Date'[Date]
)
RETURN
IF (
ISBLANK ( [Number of rows] ),
BLANK (),
CALCULATE (
[Number of rows],
FILTER ( ALL ( 'Date' ), 'Date'[Date] = PrevDate )
)
)
- Delphia5 years ago
Advocate II
Thank you Paul. Please find the reponse of the system on the screenshot.
Nevertheless, the column Number of Rows exists...
Please find sample of my pbix file here: Please find my sample pbix file here: https://drive.google.com/file/d/1AWknO_abSZnNmKnzsOdKhhUdF9XbLkfb/view?usp=sharing
Thank you in advance for your help!
- PaulDBrown5 years ago
Community Champion
- Delphia5 years ago
Advocate II
Thank you, Paul. It works as a measure, nevertheless, it shows todays values, not for the previous date. Please have a look at my screenshot:
Thank you one more time!