Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello!
I have recently been struggling to using a paramter in caluclations in DAX. Currently I have been attempting to use a parameter for a user to input the years of interest. After determining the years of interest the hope is to be able to identify the range (and eventually perform specific calculations on those years.
I have began this process with a simple identifying DAX code but it seems to not recognize the values correctly and I am unsure why. I will describe my process below...
1. Import table (Table4) of years ([years]).
2. Create parameter using the modeling tab in the desktop for values 2000-2016. DAX code seen below for paramter.
"Parameter Years (strt) = GENERATESERIES(2000, 2030, 1)"
3. Create a measure referencing this parameter. DAX seen below.
"Measure = selectedvalue('Parameter Years (strt)'[Parameter Years])"
4. Reference this measure in a new column. DAX seenbelow.
"Identifier Column = if(Table4[Years] = [measure],1,0)"
When the parameter is set to 202 (or any other value) all of the values in the new custom column read 0. Although if I change the dax formula for the column to represent a number rather than the measure the formula works correctly and identifies the number I was looking for. With saying this I was wondering if there were specific limitations to using measures and or parameters in calculationsin this scenario?
Thanks in advance. I would be happy to provide more information if it is needed as well!
Austin I
Solved! Go to Solution.
Hi @Anonymous
You may use below measure2 to get dynamic parameters.For example:
Measure 2 = IF(MAX(Table1[Years])=[measure],1,0)
Regards,
Hi @Anonymous
You may use below measure2 to get dynamic parameters.For example:
Measure 2 = IF(MAX(Table1[Years])=[measure],1,0)
Regards,
That worked perfectly thanks so much!!
Austin I
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
56 | |
54 | |
54 | |
37 | |
29 |
User | Count |
---|---|
78 | |
64 | |
45 | |
40 | |
40 |