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
jpdren
Frequent Visitor

Trouble replicating Excel formula in Power BI

I'm trying to replicate an Excel formula in Power BI. The formula gives me a running average for a selected metric. The Excel formula is: Goal=SUM(range)/((YEAR(LDate)-YEAR(EDate))*12+MONTH(LDate)-MONTH(EDate)+1), with LDate (Later Date) = refresh date, and EDate (Earlier Date) = start date. 

 

In Power BI I've tried replicating this with Goal = Calculate(SUM('Main Daily Data'[Page Views]),((Year(Today())-Year(Date(2018,5,2)))*12+Month(Today))-Month(Date(2018,5,2))+1). 

 

When I run this formula in Power BI I get an error that reads," The True/False expression does not specify a column. Each True/False expression used as a table filter must refer to exactly one column. Not sure where to go. If anyody can help, it would be apprechiated. 

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

 

The second input of the CALCULATE() function should be a column or expression that you would like to filter.  Your second input is just an expression so that formula does not know which already written expression or base data column to apply a filter condition on.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

1 REPLY 1
Ashish_Mathur
Super User
Super User

Hi,

 

The second input of the CALCULATE() function should be a column or expression that you would like to filter.  Your second input is just an expression so that formula does not know which already written expression or base data column to apply a filter condition on.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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.