Forum Discussion
How to control computed columns by filtering changes in variables?
4 Replies
- AnonymousNot applicable
Hi YMY ,
Your idea is correct, but it seems that you should be using calculated columns. Calculated columns are static values added to the table and are calculated row by row when loading data. In contrast, measure is a dynamic value that changes based on what you view in the report, dynamically calculated in the context of the visual's filter. For more information about calculated columns and measures, please refer to the link: Understanding Measures vs Calculated Columns in Power BI (gorilla.bi).
Therefore, this can be achieved using measure.Len_num = GENERATESERIES(1,MAX('Table'[Len_max]),1)Measure = VAR settings = SELECTEDVALUE(Len_num[Values]) VAR ConvertMe = LEFT( RIGHT(MAX('Table'[Num]),LEN(MAX('Table'[Num])) - settings + 1),10) RETURN ConvertMeIf your Current Period does not refer to this, please clarify in a follow-up reply.
Best Regards,
Clara Gong
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- YMYRegular Visitor
Hi, I'm glad you suggested it. I tried to do it, but“Values” as a filter still can't change the Values generated by ConvertMe dynamically. I'm sorry for not being clear at the beginning, but the first"解析12"is the computed column.
- AnonymousNot applicable
Hi YMY ,
As my reply above said, calculated columns are only calculated once when the table is first loaded or refreshed; this happens during the query. Therefore, calculated columns provide static values that do not change based on the filter context, making them more predictable and easier to understand in certain situations. In contrast, measure is a dynamic value, and these dynamic calculations change based on user actions such as filtering or slicing. This way, you can use the same measure for different visuals and data parts.
So you can modify your calculated column to measure so that it changes with slicer selection. You can download the pbix file in my previous reply to view. The Column column is a calculated column. It will not change according to the selection of the slicer, while the measure column will change accordingly.
If your Current Period does not refer to this, please clarify in a follow-up reply.
Best Regards,
Clara Gong
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.