cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
majid_75
Frequent Visitor

Dax Measure with Forecast

Hello,

 

I want a  bar chart or aother like this image :

 

I have a select Year and  Month : 2020 and 08

 

image.png

 

So Blue is my measure total sale for example 01/01/2020 until 31/08/2020 :
Total Sales = Sum(Sales)

And Purple is my measure Pipe 01/09/2020 until 31/12/2020:

Pipe = CALCULATE(
[forcast],
FILTER(
ALL('Date'),
'Date'[Year]=YEAR(DATE(SELECTEDVALUE('Date'[Year]),SELECTEDVALUE('Date'[Month]),1 ))
&& 'Date'[Yearmonth] > SELECTEDVALUE('Date'[Yearmonth])
&& 'Date'[Date] <= ENDOFYEAR('Date'[Date])
)
)

 

But it's don't work, pls help me!

 

Thanks!

1 ACCEPTED SOLUTION
CNENFRNL
Super User III
Super User III

Hi, @majid_75 , I assume you're intended to apply filters this way,

Pipe =
VAR __EndOfYr = ENDOFYEAR ( 'Date'[Date] )
RETURN
    CALCULATE (
        [forcast],
        'Date'[Yearmonth] > SELECTEDVALUE ( 'Date'[Yearmonth] ),
        'Date'[Date] <= __EndOfYr
    )

View solution in original post

2 REPLIES 2
majid_75
Frequent Visitor

Hello @CNENFRNL ,

 

Thanks you very much but it's don't work.

CNENFRNL
Super User III
Super User III

Hi, @majid_75 , I assume you're intended to apply filters this way,

Pipe =
VAR __EndOfYr = ENDOFYEAR ( 'Date'[Date] )
RETURN
    CALCULATE (
        [forcast],
        'Date'[Yearmonth] > SELECTEDVALUE ( 'Date'[Yearmonth] ),
        'Date'[Date] <= __EndOfYr
    )

View solution in original post

Helpful resources

Announcements
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Get Ready for Power BI Dev Camp

Microsoft named a Leader in The Forrester Wave

Microsoft received the highest score of any vendor in both the strategy and current offering categories.

Get Ready for Power BI Dev Camp

Power BI Dev Camp - September 30th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.