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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
PowerBIUser1995
New Member

Hi! Challenging Problem with PreviousMonth() using a measure as a filter

Hi everyone!,

I am trying to calculate the following but I just obtain a blank space: It is defined the following:

==> These measures works fine:

  • SalesLastMonth:=calculate([Sales],PREVIOUSMONTH(Calendar[Day]))
  • Incentive_AchievementRate:=divide(calculate([Sales],filter(Target_Table,Target_Table[Target]>0)),sumx(Target_Table,Target_Table[Target]))

 

==>BUT This doesn't work!!:

  • SalesOfWinners_LastMonth:=calculate([SalesLastMonth],filter(Sales_All,[Incentive_AchievementRate]>1))

 

What I need to know is the sales of the last month, but only of the ones that won the incentive this month. The structure works when I use as a filter a column that exists in a Table instead of a measure (as [Incentive_AchievementRate])

 

What can I do?

Thanks!

1 ACCEPTED SOLUTION
mahoneypat
Microsoft Employee
Microsoft Employee

It's hard to tell without seeing your model, but it looks like you are filtering the whole fact table - Filter(Sales_All), ...

What field/column do you calculate incentive winners on usually (employees, departments, etc.)?  I would have expected you had Filter(All(Sales_All[Employee]), [Incentive_AchievementRate]>1) instead.

 

If this solution works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

2 REPLIES 2
mahoneypat
Microsoft Employee
Microsoft Employee

It's hard to tell without seeing your model, but it looks like you are filtering the whole fact table - Filter(Sales_All), ...

What field/column do you calculate incentive winners on usually (employees, departments, etc.)?  I would have expected you had Filter(All(Sales_All[Employee]), [Incentive_AchievementRate]>1) instead.

 

If this solution works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Indeed, the problem was the table. Thanks!

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.