cancel
Showing results for
Did you mean:
Helper III

## Sales till yesterday or today for all the years

I have a table with sales of respective date for few years. I use july 1st - June 30 as fiscal year. My  table looks like this.

 Date Sales 15/05/2019 \$      234,523 15/10/2019 \$        54,576 15/12/2019 \$          7,953 15/05/2020 \$      239,846 15/10/2020 \$      304,957 15/12/2020 \$        34,095 15/05/2021 \$          4,954 15/10/2021 \$        34,985 15/12/2021 \$              678 15/05/2022 \$        34,897 15/10/2022 \$        23,654 15/12/2022 \$        49,685

I want to see each year sales from july 1st till the date which is today 15-10-2021. I want the outcome to be like below. Kindly help in this regard. Outcome is below:

 Outcome Outcome 2019 \$   54,576 2020 \$ 304,957 2021 \$   34,985 2022 \$   23,654
1 ACCEPTED SOLUTION
Community Support

Hi @Hamdan1234 ,

Try the following measure, if the date meets the condition set to 1, otherwise 0. Then add it to Filter on this visual. I did the test with the following reference.

``````M =
VAR a_month =
MONTH ( MAX ( 'Table'[Date] ) )
VAR a_day =
DAY ( MAX ( 'Table'[Date] ) )
RETURN
IF (
a_month >= 7
&& a_month < 10,
1,
IF ( a_month = 10 && a_day >= 1 && a_day <= 15, 1 )
)``````

If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.

Best Regards,
Henry

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support

Hi @Hamdan1234 ,

Try the following measure, if the date meets the condition set to 1, otherwise 0. Then add it to Filter on this visual. I did the test with the following reference.

``````M =
VAR a_month =
MONTH ( MAX ( 'Table'[Date] ) )
VAR a_day =
DAY ( MAX ( 'Table'[Date] ) )
RETURN
IF (
a_month >= 7
&& a_month < 10,
1,
IF ( a_month = 10 && a_day >= 1 && a_day <= 15, 1 )
)``````

If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.

Best Regards,
Henry

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Announcements