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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.