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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
GKK1
Helper II
Helper II

Can we override a measures value with parameter

Hi Power BI community,

 

I am working on a report, where I am asked to override a value if a value is selected from Parameter. 
I have a matrix where I have a measure = Hours worked * avg_Daily_wage. Now my customer wants if minimum wage changes, they need a parameter which will override the avg_Daily_wage value in the measure.

I am still new here and need to learn how to add the images in my post. I hope I made it clear with my ntoes.

 

I would really appriciate your help. 

 

Best regards,
GK

 

1 ACCEPTED SOLUTION
jgeddes
Super User
Super User

A measure like the following will do what you are looking for

Cost =
var _parameterValue =
HASONEVALUE('Avg Wage Override'[Avg Wage Override])
Return
IF(
    _parameterValue,
    SUM(hoursTable[Hours]) * 'Avg Wage Override'[Avg Wage Override Value],
    SUM(hoursTable[Hours]) * [Average Daily Wage]
)
 
You would need to ensure that the parameter slicer has any values cleared out if they are not intended to be used.
 
jgeddes_0-1702584965930.pngjgeddes_1-1702584985515.png

 

 



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

Proud to be a Super User!





View solution in original post

2 REPLIES 2
GKK1
Helper II
Helper II

@jgeddes , thank you very much for your suppoprt. It wokred. I was not sure if we can use paramenters in the variables and use them in If statement. 

jgeddes
Super User
Super User

A measure like the following will do what you are looking for

Cost =
var _parameterValue =
HASONEVALUE('Avg Wage Override'[Avg Wage Override])
Return
IF(
    _parameterValue,
    SUM(hoursTable[Hours]) * 'Avg Wage Override'[Avg Wage Override Value],
    SUM(hoursTable[Hours]) * [Average Daily Wage]
)
 
You would need to ensure that the parameter slicer has any values cleared out if they are not intended to be used.
 
jgeddes_0-1702584965930.pngjgeddes_1-1702584985515.png

 

 



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

Proud to be a Super User!





Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.