Forum Discussion

febing's avatar
febing
Frequent Visitor
2 years ago
Solved

Power BI - 2 Columns with similar values

Hi I am pretty new to Power BI. Have a very basic question. I am preparing a roster report on a calendar matrix view based on excel data. Now the concern is I have 2 columns Task 1 and Task 2 having...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi febing 

     

    Not sure if I understand the target correctly. You can add an additional table to have all distinct task values in a column. Lets call the table 'Dim Task'. Make sure this table is disconnected from other tables. Use task column from this 'Dim Task' table into the slicer. Then you can try the following measure to count the results. 

    count measure =
    VAR _selectedTask = SELECTEDVALUE ( 'Dim Task'[Task] )
    RETURN
        COUNTROWS ( FILTER ( 'table', 'table'[Task 1] = _selectedTask ) ) + COUNTROWS ( FILTER ( 'table', 'table'[Task 2] = _selectedTask ) )
    

     

    Best Regards,
    Jing
    If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!