Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.