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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
JustinDoh1
Post Prodigy
Post Prodigy

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.

Table1.png

 

Here is the formula for "Forecast".

Param0.png

 

Now, I am trying to apply the value of "Forecast" into this Calculate & Filter measure.

Param1.png

 

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
AlexisOlson
Super User
Super User

[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 )
    )

View solution in original post

5 REPLIES 5
AlexisOlson
Super User
Super User

[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 )
    )

@AlexisOlson 

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).

 

img1.png

img2.png

 

Isn't it a calculated column (just based on what I see)?

Sorry. I am a beginner in DAX.

 

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.

@AlexisOlson 

Thank you for quick response and help!

amitchandak
Super User
Super User

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

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.