cancel
Showing results for
Did you mean:
Member

## Current Year Sales

Hello all,

I am currently stuck with calculating the sales of current year Sales.
So the goal is to show a line graphic that shows sales data from 1 januari of 2019 until 9 januari 2019. On this Power BI report page a user must not filter any visuals..

My current measure Current Year Sales is as below:

Current Year Sales = CALCULATE(SUM('Sales invoice line'[Line amount MST]);
YEAR('Dim Calender Sales Invoice'[FullDateAlternateKey])=YEAR(TODAY()))

Any suggestions?

Thank you
1 ACCEPTED SOLUTION

Accepted Solutions
Super Contributor

## Re: Current Year Sales

Hi @regasanyoto,

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
6 REPLIES 6
Established Member

## Re: Current Year Sales

Can you please elaborate a little more what you are trying to acheive. As per your post above, the measure is correct and shows the current year sales only.

So what is the probelm?

Thanks & Regards

Affan

Member

## Re: Current Year Sales

Hi @affan,

The measure is correct indeed. but the when i display this on a table

The result is now

date

Member

## Re: Current Year Sales

Year               Sales
2016        560.000
2017        560.000

2018        560.000

2019        560.000

I expect the following table result

Year           Sales
2016        0
2017        0

2018        0

2019        560.000

So how can i get this result based on my current measure of Current Year Sales

Current Year Sales = CALCULATE(
SUM('Sales invoice line'[Line amount MST]);
YEAR('Dim Calender Sales Invoice'[FullDateAlternateKey])=YEAR(TODAY()))

Regular Visitor

## Re: Current Year Sales

Hi @regasanyoto,

You can create a calculate column in 'Dim Calender Sales Invoice' :

```IsCurrentYear =
VAR TodayDate =
TODAY ()
VAR CurrentYear =
YEAR ( TodayDate )
RETURN
'Dim Calender Sales Invoice'[FullDateAlternateKey]
>= DATE ( CurrentYear, 01, 01 )```

Then the following measure:

```Current Year Sales =
VAR Temp =
CALCULATE (
SUM ( 'Sales invoice line'[Line amount MST] ),
'Dim Calender Sales Invoice'[IsCurrentYear] = TRUE ()
)
RETURN
IF ( Temp = BLANK (), 0, Temp )```

Best Regards

Chiara

Highlighted
Super Contributor

## Re: Current Year Sales

Hi @regasanyoto,

Based on my test, this measure could work on my side:

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Super Contributor

## Re: Current Year Sales

Hi @regasanyoto,

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Announcements

#### Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

#### Community News & Announcements

Get your latest community news and announcements.

#### Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

#### Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Top Kudoed Authors
Users Online
Currently online: 206 members 2,223 guests
Recent signins: