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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Selected value of parameter

Hi everyone,

 

I'm struggling to use a parameter value to calculate a new column based on an existing column with year values.

The basic idea is to have the user select a certain year "GrantYear" and the difference between this grant year and 2023 needs to be added to the column. In the example below, you can see there should be 3 years added.

pieternobels_0-1698410551430.png

Any help more than welcome!

 

5 REPLIES 5
Anonymous
Not applicable

So I have a table with the years between 2023 and 2035 called "YearCal", which should serve as the x-axis of my simulation visuals

 

However, I want the user to be able to let the simulation start at a later period (and shift the full period), by change the paramater "GrantYear". 

 

GrantYear = GENERATESERIES(2023, 2040, 1) 

 

I have a measure "Year Diff" calculated that says 

 

Year diff = 'GrantYear'[GrantYear Value]-2023 

 

Than I have a column calculated, "UpdatedCal" in the same table as where my original input column "YearCal" is, which is basically :

 

UpdatedCal = 'Table'[YearCal]+ [Year diff] 

 

Then if all goes well, I can use "UpdatedCal" for my x-axis in my visual.

 

However, I see that the measure "YearDiff" calculates correctly, but when it calculates the column "UpdatedCal", it seems to take the default value of the parameter and not the selected value.

 

 

 

 

 

 

Hi @Anonymous 

 

It is not a good practice to base a calculated column on a measure.  Calculated columns are set during refresh whereas measures are calculated 'on-demand' when filters (or slicers...) change.  I hope this makes sense.

 

I would try to avoid that by making [UpdatedCal] a measure instead of a calculated column. 

 

There are ways to get around the problem of trying to use a measure in an axis.  (You can generate a table that is simply a list of all possible years and make the comparison in the measure instead of via a relationship.)

 

I would suggest working on the measures at this point and tackle the axis-problem afterwards.

 

Let me know if you have any questions.



Proud to be a Super User!

daxformatter.com makes life EASIER!
Anonymous
Not applicable

Thanks for the reply... I've taken out the measure out of the equation, by determining the calculated column [UpdatedCal] by directly referring to the parameter:

UpdatedCal = 'Table'[YearCal]+GrantYear[GrantYear Value]-2023
 
However, still not the desired effect. 

It should still take the default value for the parameter since the calculated column is created before any user interaction.



Proud to be a Super User!

daxformatter.com makes life EASIER!
eliasayyy
Memorable Member
Memorable Member

hello @Anonymous can you please explain in more details maybe the emasures your goal and some sample data.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.

Top Solution Authors