Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
I have created a parameter on Power BI Report Builder. I specified a 'Name' for the parameter and a 'Prompt'. I also specified a data type which seems to be linked to the 'Value field'. The image can be seen below:
I have also specified a value and label field. What does the 'Value field' and 'Label field' refer to?.
Strangely when I run the report I can choose values I entered in the 'Label Field' eariler even though I had set the 'Data Type' to 'text'. However, when I run the report I don't get any values for ID or Movies.
However, when I change the 'Value field' to 'ID' and...
run the report, values appear in the report this time.
1. What is meant by 'Data Type' underneath 'Prompt'? For which variable is it referring to?
2. What is the difference between 'Value field' and 'Label field'?
3. Why is it that when I ran my report the first time I got no values for 'ID' and 'Movies'?
Thank you
Solved! Go to Solution.
@HamidBee wrote:
1. What is meant by 'Data Type' underneath 'Prompt'? For which variable is it referring to?
It is referring to the data type to use for the parameter itself
@HamidBee wrote:
2. What is the difference between 'Value field' and 'Label field'?
The Value is what is passed to the query typically to be used as a filter of some sort. The Label is the value to show to the user in the drop down. Sometimes these can be the same field, but other times you might want to show the user a list of movie names, but then pass through the movie ID as it can make the underlying query easier and more performant as you can sometimes then elminate a join.
@HamidBee wrote:
3. Why is it that when I ran my report the first time I got no values for 'ID' and 'Movies'?
This is probably because you query would have been evaluated as something like the following the first time
SELECT ... FROM movies WHERE ID = 'The Godfather'
And there are no ID values of 'The Godfather' so you get 0 rows.
The second time you ran the query it would have been evaluated as
SELECT ... FROM movies WHERE ID = '1'
And SQL would have done an implicit cast from the string '1' to the integer value of 1. It is normally better to avoid implied casts and set the datatype of your parameter to match the datatype of the column you are filtering.
@HamidBee wrote:
1. What is meant by 'Data Type' underneath 'Prompt'? For which variable is it referring to?
It is referring to the data type to use for the parameter itself
@HamidBee wrote:
2. What is the difference between 'Value field' and 'Label field'?
The Value is what is passed to the query typically to be used as a filter of some sort. The Label is the value to show to the user in the drop down. Sometimes these can be the same field, but other times you might want to show the user a list of movie names, but then pass through the movie ID as it can make the underlying query easier and more performant as you can sometimes then elminate a join.
@HamidBee wrote:
3. Why is it that when I ran my report the first time I got no values for 'ID' and 'Movies'?
This is probably because you query would have been evaluated as something like the following the first time
SELECT ... FROM movies WHERE ID = 'The Godfather'
And there are no ID values of 'The Godfather' so you get 0 rows.
The second time you ran the query it would have been evaluated as
SELECT ... FROM movies WHERE ID = '1'
And SQL would have done an implicit cast from the string '1' to the integer value of 1. It is normally better to avoid implied casts and set the datatype of your parameter to match the datatype of the column you are filtering.
Thanks for the very detailed explanation. Things are starting to click for me. Except for.....cascading parameters. It worked okay when I created one and two. But the third one really got me.
https://community.powerbi.com/t5/Desktop/Cascading-Report-in-Power-BI-Report-Builder-Causing-Errors/...
Please feel free to take a look if you ever get the chance.
@HamidBee wrote:
Thanks for the very detailed explanation. Things are starting to click for me. Except for.....cascading parameters. It worked okay when I created one and two. But the third one really got me.
https://community.powerbi.com/t5/Desktop/Cascading-Report-in-Power-BI-Report-Builder-Causing-Errors/...
Please feel free to take a look if you ever get the chance.
It seems you already have 2 responses to that other question
Thanks for taking a look anwyay.