Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi all,
I have the following problem that I would like to add a column with a hardcoded value (either a string or number) but would like to add the value only to the currently displayed rows of the visual. The visual is a table and conststs of columns from three different dimensional tables (Calendar, Dim City & Dim StockItem). The problem is the following: As soon as I add that measure the table get expanded by all rows available. Can anyone tell me what I am getting wrong?
Below is the table without the measure:
This is the expanded version of the table after I have added a measure that should only add a column with the value 1 in it.
Your help is very much appreciated!
Solved! Go to Solution.
In case others have to add a dummy column with a hardcoded value to a table visual I wanted to provide the way I could solve it.
First approach:
The problem with creating a measure that just contains the value and then throwing it into the visual as the other columns is that it has no relation to the tables and columns used in the visual. Thus, it doesnt know for which rows of the two tables the measure should be displayed and therefore, it shows all rows.
--> doesn't work!
Second approach:
I created a measure that consist of a variable that checks whether a vlaue of a specific column is selected by using the SELECTEDVALUE function. Afterwards, I checked in a IF condition whether this selected value is not blank and if not returned my hardcoded column. The function doesnt understand the interconnection of the three dimensional tables either and will display all rows as well. So I tried to create a variable for all three columns and the respective rows selected and checked them in the IF clause but with no success.
--> doesn't work!
Third approach (and this is the winner):
While working on the second solution I finally got the idea. The SELECTEDVALUE wont understand the relationship when selected a column from the dimensional table. But these three tables are connected by the Fact table (FactSale) and this is also the factor why only specific colors have been displayed for specific states for my selected date. Therefore, I just needed to check for the delivery date column in the fact table (which was used for the relationship between the two) and check which values are selected and then assign the respective dummy value to it.
Of course, it is debatable why creating a hardcoded column to a table visual but I guess sometimes it is beyond our power to decide what stakeholders want to look at in their reports. Below you can see the final result.
--> does work!
If anyone has another solution please feel free to share cause I am wondering if there are other ways to solve that. 🙂
@NrAg So what is filtering the top table? Why aren't the additional rows being displayed? Is there another measure in your table visual or are you doing some kind of filtering in the filter pane or ?
The top table is filtered by the date and shows all combinations available of the fact table FactSale. Below is the Model view. The measure so far is just: dummy_selected = 1
That would be the result of the fact Table if filtered by the 04.01.2022. I added to calculated columns with the related results from the dimensional tables.
There are no other measures involved. I just want to add dummy columns to the table visual.
Additional info: I cannot create calculated columns for the dummy values. It is necessary to pull them via a measure into the visual (table).
In case others have to add a dummy column with a hardcoded value to a table visual I wanted to provide the way I could solve it.
First approach:
The problem with creating a measure that just contains the value and then throwing it into the visual as the other columns is that it has no relation to the tables and columns used in the visual. Thus, it doesnt know for which rows of the two tables the measure should be displayed and therefore, it shows all rows.
--> doesn't work!
Second approach:
I created a measure that consist of a variable that checks whether a vlaue of a specific column is selected by using the SELECTEDVALUE function. Afterwards, I checked in a IF condition whether this selected value is not blank and if not returned my hardcoded column. The function doesnt understand the interconnection of the three dimensional tables either and will display all rows as well. So I tried to create a variable for all three columns and the respective rows selected and checked them in the IF clause but with no success.
--> doesn't work!
Third approach (and this is the winner):
While working on the second solution I finally got the idea. The SELECTEDVALUE wont understand the relationship when selected a column from the dimensional table. But these three tables are connected by the Fact table (FactSale) and this is also the factor why only specific colors have been displayed for specific states for my selected date. Therefore, I just needed to check for the delivery date column in the fact table (which was used for the relationship between the two) and check which values are selected and then assign the respective dummy value to it.
Of course, it is debatable why creating a hardcoded column to a table visual but I guess sometimes it is beyond our power to decide what stakeholders want to look at in their reports. Below you can see the final result.
--> does work!
If anyone has another solution please feel free to share cause I am wondering if there are other ways to solve that. 🙂
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 40 | |
| 35 | |
| 34 | |
| 31 | |
| 28 |
| User | Count |
|---|---|
| 136 | |
| 102 | |
| 68 | |
| 66 | |
| 58 |