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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Nerdio
New Member

Creating constants

I am new to using Power BI and I am just dabbling with the functionality to see what can be done. The application I have in mind will have a lot of calculations where a constant value is used. Rather than hard code the constant value into each calculation it would seem sensible to have this defined somewhere like a constant variable. The value may change in the future, so it needs to be accesible.
I am thinking of something like a table of constants comprising name and value, but I understand that this may not be workable.

Can anyone suggest a way to store constants in a mutable way, that can be easily accessed for calculations on other tables?

 

Thanks.

6 REPLIES 6
v-prasare
Community Support
Community Support

We would like to confirm if our community members answer resolves your query or if you need further help. If you still have any questions or need more support, please feel free to let us know. We are happy to help you.

 

 

 

Thank you for your patience and look forward to hearing from you.
Best Regards,
Prashanth Are
MS Fabric community support

v-prasare
Community Support
Community Support

We would like to confirm if our community members answer resolves your query or if you need further help. If you still have any questions or need more support, please feel free to let us know. We are happy to help you.

 

 

 

Thank you for your patience and look forward to hearing from you.
Best Regards,
Prashanth Are
MS Fabric community support

danextian
Super User
Super User

Hi @Nerdio 

A measure can actually accept a constant value and can be referenced in other calculations. Example

Constant Value - Number = 100

Constant Value - Text = "100"




Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
krishnakanth240
Power Participant
Power Participant

Hi @Nerdio 

 

Create a table(Name, Value) and read it via a measure.Update the value in one place, all other calculations will update.Value = MAX( Constants[Value])

Thank you for your answer. 
Can I create a table for the constants directly in Power BI, instead of importing one? I can't add one to the DB Source for the other data. I could have a separate spreadsheet of course, but a table built-in to Power BI. Sorry for a fairly basic question but I am new to Power BI. 

Thanks

Ashish_Mathur
Super User
Super User

Hi,

If with a change in your constant value (whenever that happens), you want that change to take effect retrospectively, then just create a measure like this

Measure = 5

Refer to this measure in your calculations.


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

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

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