Forum Discussion
Dynamic Calculated Column as Visual dimension
- 3 years ago
Hi kahn_ohara
You are correct. Calculated columns in Power BI cannot be dynamic according to user input in the report. Only measures and what-if parameters can be dynamic. However, measures and what-if parameters cannot be used as visual dimension fields. They can only be used as value fields. So you need a table column as a dimension field, which can provide segmentation/filter for other measures.
For example, I add a Group table which only has values 1 and 2. These two values will be used in other measures to provide different calculations for two groups. To show ">=X" and "<X" values, I use a measure and a what-if parameter.
So the result is similar to below.
The problem is that the Group column cannot be removed from the table visual. It should be there to act as a dimension field because all other measures cannot do that job. I have attached a sample file at bottom. Hope this would be helpful.
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
Hi kahn_ohara
You are correct. Calculated columns in Power BI cannot be dynamic according to user input in the report. Only measures and what-if parameters can be dynamic. However, measures and what-if parameters cannot be used as visual dimension fields. They can only be used as value fields. So you need a table column as a dimension field, which can provide segmentation/filter for other measures.
For example, I add a Group table which only has values 1 and 2. These two values will be used in other measures to provide different calculations for two groups. To show ">=X" and "<X" values, I use a measure and a what-if parameter.
So the result is similar to below.
The problem is that the Group column cannot be removed from the table visual. It should be there to act as a dimension field because all other measures cannot do that job. I have attached a sample file at bottom. Hope this would be helpful.
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
Thank you!
I will say that coming from a Tableau or Sql background this seems like a fairly big limitation, but the solution you shared defniitely will get the job done and that is good. I will just note to future readers that as of 5/3/2023 the what if parameter can only accept a finite range of values and can't have more than 1002 values. See below.
So for example, a parameter with range from -20 to 20 with increments of .01 is impossible because this would be 40 x 100 = 4,000 individual values > 1002 values. The fact that you also can't just have an arbitrary floating number parameter with no limits also seems quite wonky to me.