cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Hamdan1234
Helper III
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
v-henryk-mstf
Community Support
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 )
    )

vhenrykmstf_0-1634537622032.png


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.

View solution in original post

1 REPLY 1
v-henryk-mstf
Community Support
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 )
    )

vhenrykmstf_0-1634537622032.png


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.

Helpful resources

Announcements
June 2022 update 768X460.jpg

Check it out!

Click here to read more about the June 2022 updates!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power BI Dev Camp Session 23 768x460.jpg

Check it Out!

Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!

June 20 episode 7 with aka link 768x460.jpg

The Power BI Community Show

Join us on June 20 at 11 am PDT when Kim Manis shares the latest on Azure Synapse analytics, the Microsoft Intelligent Data Platform, and notable Power BI Updates from Microsoft Build 2022.

Top Solution Authors
Top Kudoed Authors