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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
loganwol
Microsoft Employee
Microsoft Employee

How do I define a value that can be used as a constant in multiple places (like measures)

Hi,

 

I'm looking to use a constant value (which is a date) that i can edit and update so that I can change my report to only show data relevant to Today - (Constant Value).

Bit of context, I have a report for current candidates hiring and their respective status in the "queue". I periodically send out the report (every week but sometimes it might becomes the last 10 days). I have a few measures such as total number of candidates which is easy but I also have some measures that has to show number of incoming candidates in the last n days. Right now I end up manually editing the measure to a specific value and have realized I forget one of the places at least.

I thought I can create a manual table with the value and then update it but soon realized that manually created tables in PBI are not updateable.

Any other way to accomplish this?

 

Regards 

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

Just create a measure like this:

 

TheAnswertotheUltimateQuestionofLifetheUniverseandEverything = 42

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

3 REPLIES 3
v-haibl-msft
Microsoft Employee
Microsoft Employee

@loganwol

 

I think you can also do it with Query Parameters. I’d like to give a simple sample. I assume we have a table like below.

How do I define a value that can be used as a constant in multiple places (like measures)_1.jpg

 

We can create a parameter and enable load to make it available to be referenced later.

How do I define a value that can be used as a constant in multiple places (like measures)_2.jpg

 

Now we can create a measure with following formula. And the parameter can be edited later.

UsersForCurrentDate = 
CALCULATE (
    SUM ( Table1[users] ),
    FILTER ( Table1, Table1[Date] = VALUES ( Parameter1[Parameter1] ) )
)

How do I define a value that can be used as a constant in multiple places (like measures)_3.jpg

 

Best Regards,

Herbert

Interesting, I was looking to use the query parameters. The Enable load flag was the part i was missing. Will give it a try.

Greg_Deckler
Community Champion
Community Champion

Just create a measure like this:

 

TheAnswertotheUltimateQuestionofLifetheUniverseandEverything = 42

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors