Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
I'm hoping to get some insight on an issue I'm having with using a parameter/lookup table selection value used in the creation of calculated table.
Scenario:
Snapshot of DATA SOURCE file
Goal:
Issue:
I've debugged every individual piece of the related measures/tables and the results are correct. I cannot for the life of me figure out why the parameter selection won't work, but hard-coding will. Any other ideas/suggestions on how to address?
Param/Lookup Table:
Measure to store param selection:
Circled part is the piece that I want changed dynamically:
Results with hard-coded param value:
Results with dynamic param selection:
Solved! Go to Solution.
Calculated columns and tables are only calculated during data load or refresh, they pay no attention to slicers or filters. If you want something to be dynamic you have to use a measure.
Hi,johnt75,thanks for your concern about this issue.
Your answer is excellent!
And I would like to share some additional solutions below.
Hello,@ajjava .I am glad to help you.
In your case, I think your subsequent ideas are correct:
1. By creating a virtual table in measure instead of the real existing calculated table, you can realize the effect of passing the filtered parameters dynamically (parameters in measure)
Use the filtered virtual table as a condition for subsequent calculated tables
Here is my test.
I used the vlaues function to create a table that displays the parameter values individually and added it to the slicer as a filtered parameter value.
The results in the table are dynamically displayed by the value of MEASURES to indirectly filter the data (you can also use the filtered data for subsequent calculations)
It is not feasible to use DAX directly in Power BI Desktop to implement dynamic filtering of calculated tables. You mentioned that the code works when you try to use hardcoding, but it is not possible to pass dynamically changing parameter values.
Calculated table/calculated column properties are static, it can't interact with filters on the visualization page, so it can't satisfy the need for dynamism, their values change only when you refresh/create the calculated table or calculated column (so calculated tables and calculated columns take up memory, they are real existent static data, whereas MEASURES are virtual table dynamic data)
Measure can interact dynamically, but it can only return a single value.
So using a measure or calculated table in Desktop does not dynamically return a table (which is the reason for your problem).
So if you want to implement the use of measure to dynamically filter out table results
Suggestion:
Create a virtual table in measure and then use the virtual table to calculated or labeled data.
Set measure = “The markers you set” in the filter field.
I recommend using a slicer to pass parameter values (create a new parameter table, do not create relationships to avoid direct filtering)
The following filtering logic creates multiple virtual tables and supports slicers passing multiple parameter values
Responsible for the projects =
VAR _userNameList =
VALUES ( UserInfo[UserName] )
VAR _userIDList =
CALCULATETABLE (
VALUES ( 'User'[UserID] ),
FILTER ( ALLSELECTED ( 'User' ), 'User'[UserName] IN _userNameList )
)
VAR _projectInfo =
CALCULATETABLE (
VALUES ( 'Project'[ProjectID] ),
FILTER ( ALLSELECTED ( 'Project' ), 'Project'[UserID] IN _userIDList )
)
RETURN
IF ( MAX ( 'Project'[ProjectID] ) IN _projectInfo, 1, 0 )
2. If you only want to show the final filtered table, you can try to use the metrics of the final table data to be filtered out into a string (using the CONCATENATEX function), and will be displayed as a result (after the connection into a string, many subsequent calculations can not be carried out, such as summing, averaging, etc., you can only show the final results of the table filtered in the card)
CONCATENATEX function (DAX) - DAX | Microsoft Learn
I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,johnt75,thanks for your concern about this issue.
Your answer is excellent!
And I would like to share some additional solutions below.
Hello,@ajjava .I am glad to help you.
In your case, I think your subsequent ideas are correct:
1. By creating a virtual table in measure instead of the real existing calculated table, you can realize the effect of passing the filtered parameters dynamically (parameters in measure)
Use the filtered virtual table as a condition for subsequent calculated tables
Here is my test.
I used the vlaues function to create a table that displays the parameter values individually and added it to the slicer as a filtered parameter value.
The results in the table are dynamically displayed by the value of MEASURES to indirectly filter the data (you can also use the filtered data for subsequent calculations)
It is not feasible to use DAX directly in Power BI Desktop to implement dynamic filtering of calculated tables. You mentioned that the code works when you try to use hardcoding, but it is not possible to pass dynamically changing parameter values.
Calculated table/calculated column properties are static, it can't interact with filters on the visualization page, so it can't satisfy the need for dynamism, their values change only when you refresh/create the calculated table or calculated column (so calculated tables and calculated columns take up memory, they are real existent static data, whereas MEASURES are virtual table dynamic data)
Measure can interact dynamically, but it can only return a single value.
So using a measure or calculated table in Desktop does not dynamically return a table (which is the reason for your problem).
So if you want to implement the use of measure to dynamically filter out table results
Suggestion:
Create a virtual table in measure and then use the virtual table to calculated or labeled data.
Set measure = “The markers you set” in the filter field.
I recommend using a slicer to pass parameter values (create a new parameter table, do not create relationships to avoid direct filtering)
The following filtering logic creates multiple virtual tables and supports slicers passing multiple parameter values
Responsible for the projects =
VAR _userNameList =
VALUES ( UserInfo[UserName] )
VAR _userIDList =
CALCULATETABLE (
VALUES ( 'User'[UserID] ),
FILTER ( ALLSELECTED ( 'User' ), 'User'[UserName] IN _userNameList )
)
VAR _projectInfo =
CALCULATETABLE (
VALUES ( 'Project'[ProjectID] ),
FILTER ( ALLSELECTED ( 'Project' ), 'Project'[UserID] IN _userIDList )
)
RETURN
IF ( MAX ( 'Project'[ProjectID] ) IN _projectInfo, 1, 0 )
2. If you only want to show the final filtered table, you can try to use the metrics of the final table data to be filtered out into a string (using the CONCATENATEX function), and will be displayed as a result (after the connection into a string, many subsequent calculations can not be carried out, such as summing, averaging, etc., you can only show the final results of the table filtered in the card)
CONCATENATEX function (DAX) - DAX | Microsoft Learn
I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Is a possible solution to change the calculated table into a virtual table, inside subsequent expressions (expressions not shown in my original post)? I'm EXTREMELY new to PBI, coming over from a Tableau background.
Calculated columns and tables are only calculated during data load or refresh, they pay no attention to slicers or filters. If you want something to be dynamic you have to use a measure.
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 |
---|---|
84 | |
76 | |
75 | |
43 | |
36 |
User | Count |
---|---|
109 | |
56 | |
52 | |
48 | |
43 |