cancel
Showing results for
Search instead for
Did you mean:  Helper I

## How to insert calculated value as Filter (Calculate/Filter) value

(Sorry this is a duplicate question that I posted few days ago, but I did not get answer/solution so I am posting it again).

I am trying to insert "What If" (New Parameter) calculation value inside Filter's value.

So, here is a scenario.

Based on value of Parameter (what if), for example here (50), "Forecast" value will be added.

So, for the first one 29.33 + (50) = 79.33. Here is the formula for "Forecast". Now, I am trying to apply the value of "Forecast" into this Calculate & Filter measure. Apparently, Measure does not like this field (Parameter[Forecast]).

Is there any way to fix this?

It appears that the issue is that it only can be used in 'measure', not in 'column' based on the bottom link.

https://community.powerbi.com/t5/Desktop/Dynamic-Calculated-Columns-using-What-If-Parameter/m-p/2918...

Then, my next question is how can I convert my formula in measure into 'measure'?

1 ACCEPTED SOLUTION  Resident Rockstar

[Forecast] is a measure, not a calculated column, so MAX([Forecast]) doesn't make sense to the calculation engine.

Try this instead:

``````StarCalculatedParameter1 =
VAR Forecast = [Forecast]
RETURN
CALCULATE (
VALUES ( Star[Value] ),
FILTER ( Star, Star[Min] <= Forecast && Star[Max] >= Forecast )
)``````
5 REPLIES 5  Resident Rockstar

[Forecast] is a measure, not a calculated column, so MAX([Forecast]) doesn't make sense to the calculation engine.

Try this instead:

``````StarCalculatedParameter1 =
VAR Forecast = [Forecast]
RETURN
CALCULATE (
VALUES ( Star[Value] ),
FILTER ( Star, Star[Min] <= Forecast && Star[Max] >= Forecast )
)``````  Helper I

I have a quick question.

You mentioned that 'Forecast' is a measure.

I have a definition of 'Forecast' as below (as well as screenshot of column in table).  Isn't it a calculated column (just based on what I see)?

Sorry. I am a beginner in DAX.  Resident Rockstar

Nope. The calculated column icon looks more like the icon next to Parameter (except "fx" instead of "?" in the bottom right corner). The calculator icon is for a measure.  Helper I

Thank you for quick response and help!  Super User IV

@JustinDoh1 , the forecast is a measure, just use [forecast] , not need to use max(Parameter[forecast])

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User! ## Helpful resources

Announcements #### Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group! #### Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks #### Power BI Dev Camp - June 24th

Mark your calendars and join us for our next Power BI Dev Camp! Top Solution Authors
Top Kudoed Authors
Users online (4,418)