Forum Discussion
Make Parameter effective using calculated column
- 6 months ago
Hi,
You’re right — this cannot work with a calculated column because calculated columns are evaluated at data refresh time, not dynamically based on slicer/parameter changes.
The solution is to move the entire logic into a measure and replace the fixed value 2000 with a What-If parameter (or numeric parameter table).
Step 1 – Create a What-If Parameter
Create a parameter (for example: Distance Threshold) and use its selected value:
Selected Threshold = SELECTEDVALUE('Distance Threshold'[Distance Threshold Value], 2000)Step 2 – Replace the Calculated Column Logic with a Measure
Instead of using [Status], embed the logic directly inside the measure and use the selected threshold:
Count ID = VAR Threshold = [Selected Threshold] RETURN CALCULATE( DISTINCTCOUNT(Work[ID]), FILTER( Work, VAR CurrentConsolidatedID = Work[Consolidated ID] VAR Previous_Date = CALCULATE( MIN(Work[Date]), ALLEXCEPT(Work, Work[Consolidated ID]) ) VAR Initial_Distance = CALCULATE( MIN(Work[Distance_1]), ALLEXCEPT(Work, Work[Consolidated ID]), Work[Date] = Previous_Date ) VAR DIF = ABS(Work[Distance_1] - Initial_Distance) VAR Count_1 = CALCULATE( COUNTROWS(Work), ALLEXCEPT(Work, Work[Consolidated ID]) ) RETURN DIF <= Threshold && Count_1 > 1 ) )Now when the parameter changes, the measure recalculates dynamically.
In short:
❌ Calculated column → static
✅ Measure + Parameter → dynamicThat’s the correct approach here.
Hope this helps.
Can you please elaborate how i can use this method to change the value of column dynamically?
You do not have dinamic in calc columns, if you want that behavior you need to solve everything with a measure
If this helped, please consider giving kudos and mark as a solution
me in replies or I'll lose your thread
Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page
Consider voting this Power BI idea
Francesco Bergamaschi
MBA, M.Eng, M.Econ, Professor of BI
- mmvohra6 months agoHelper II
Can you suggest a measure?