Forum Discussion

NrAg's avatar
NrAg
Frequent Visitor
4 years ago
Solved

Hardcoded Column expands table visual by all values

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 ...
  • NrAg's avatar
    NrAg
    3 years ago

    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. 🙂