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
azaterol
Helper V
Helper V

Sales previous years

Hey all,

I have a measure which calculate the sales from 2020/01/01 until 2020/8/3.

Sale 2020 until 03.08. = 
Calculate(Customers[Sale]-0,DATESBETWEEN('Date'[Date],DATE(2020,1,1),DATE(2020,8,3)))

But this isin`t like what I want to have, because I have to update it manually every day! 😞

I want a measure for each previous year(2020,2021) which calculate from 01.01. until todays Day-Date. Like today is the 3rd of august, it should automatically calculate the previous year 2020 from 2020/01/01 until 2020/08/03.

The same measure for 2020 I can use for 2021 and 2022 also. 

 

Here is the sample, for better understand.

https://easyupload.io/n3d27r

 

sample2.PNGsample1.PNG

1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@azaterol,

 

Try this measure:

 

Sale 2020 until 03.08. =
CALCULATE (
    Customers[Sale] - 0,
    DATESBETWEEN (
        'Date'[Date],
        DATE ( 2020, 1, 1 ),
        DATE ( 2020, MONTH ( TODAY () ), DAY ( TODAY () ) )
    )
)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

2 REPLIES 2
DataInsights
Super User
Super User

@azaterol,

 

Try this measure:

 

Sale 2020 until 03.08. =
CALCULATE (
    Customers[Sale] - 0,
    DATESBETWEEN (
        'Date'[Date],
        DATE ( 2020, 1, 1 ),
        DATE ( 2020, MONTH ( TODAY () ), DAY ( TODAY () ) )
    )
)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




@DataInsights works perfect! Thank you! 

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.