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

Measure Not Returning Prior Year Results

Hello all,

I'm trying to get the count of orders for a previous year. I have the answer via filters, but I'm trying to get it in a measure as part of a larger calculation. However, the below function does not seem to be filtering the data and is instead returning the results of all the years. Anyone know why? 

 

Count of Orders in the Previous Year = CALCULATE([Multi Origin Order Count], Filter(FactTable, YEAR(today())-1))
 
Thanks!
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Impactful Individual
Impactful Individual

Re: Measure Not Returning Prior Year Results

You can try:

 

 

Count of Orders in the Previous Year = CALCULATE([Multi Origin Order Count], Filter(FactTable, [Datecolumn] = YEAR(today())-1))

 


If its a datatimecolumn use YEAR([datecolumn]) ofcourse.

View solution in original post

2 REPLIES 2
Highlighted
Impactful Individual
Impactful Individual

Re: Measure Not Returning Prior Year Results

You can try:

 

 

Count of Orders in the Previous Year = CALCULATE([Multi Origin Order Count], Filter(FactTable, [Datecolumn] = YEAR(today())-1))

 


If its a datatimecolumn use YEAR([datecolumn]) ofcourse.

View solution in original post

Highlighted
Frequent Visitor

Re: Measure Not Returning Prior Year Results

I swapped the filtering of the fact table to filter the date dim table and that worked per your solution. 

 

Count of Orders in the Previous Year = CALCULATE([Multi Origin Order Count], 
 FILTER(DimDate, DimDate[Year] = YEAR(TODAY())-1))

 

Thanks!

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

July 2020 Community Highlights

July 2020 Community Highlights

Learn about the exciting things that happened in July.

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

We are thrilled to announce we will begin running a monthly webinar series named Power BI Dev Camp.

Power BI Desktop August 2020 Update

Power BI Desktop August 2020 Update

We have great updates this month! Click the link for the video with more info.

Top Solution Authors
Top Kudoed Authors