Forum Discussion
Use a parameter as input for a measure or a table
I need to create a visual where the histogram is recalculated every time the user insert a value in the visual, using a parameter.
Example:
"current cost of item": 3
the histogram show as the Y the final price of the item
My steps are:
Modeling > New Parameter > Numeric Range > fill the fields (even the default number)
then add to my screen the slider (but the default number is not showed in the view, i dont know why)
then in the "Data" pannel appears the new parameter with two row, one is GENERATESERIES, with every value the parameter can have, then the MEASURE "Parameter Value = SELECTEDVALUE('Parameter'[Parameter], 3)"
Ok i have used the "Parameter Value" in a card, and it change the value according the slider.
Then i have used the "Parameter Value" in a formula inside a table (created a new column and done something like this
"new_column = tablecolumn1 * Parameter Value + tablecolumn2 * Parameter Value"
and the only value that the parameter Value assume in this table is the default value (3 in this scenario)
I dont know if i need to do other steps to configurate the measure, or i have to refresh the table (i tried with "Refresh" function, but seems to refresh only the import data)
I have tried this: https://learn.microsoft.com/en-us/power-bi/transform-model/desktop-what-if
to use a measure instead of a column to set the value for the histogram, but if i have a table like this
| item | variation | kg | price |
| melon | 1 | 20 | =variation*parameter+kg*parameter |
| apple | 2 | 30 | =variation*parameter+kg*parameter |
| kiwi | 2 | 10 | =variation*parameter+kg*parameter |
and i would like to use the measure instead of the column "price", the Y value referes to the sum of the column. I dont get how in the example is able to keep divided the X values
Thanks
1 Reply
- AnonymousNot applicable
HI RandomFre,
Current power bi does not support to create dynamic calculated column/table based on filter effects. They do not work on the same level, and you can't use child level of effect its parent.
For this scenario, you may need to use measure expression to instead. (notice: power bi does not support to use measure expression as visual axis to expand row contents)
Notice: the data level of power bi(from parent to child level)
Database(external) -> query table(query, custom function, query parameters) -> data model table(table, calculate column/table) -> data view with virtual tables(measure, visual, filter, slicer)
Regards,
Xiaoxin Sheng