Forum Discussion

SteffanH's avatar
SteffanH
Frequent Visitor
6 years ago
Solved

How to summarise and transpose (?) data

I have the following (simplified) data Column Current Value Previous value CL1 Transitioning Leading CL2 Leading Winding Down CL3 Considering Promising CL5 Transitioning Pro...
  • MFelix's avatar
    6 years ago

    Hi SteffanH ,

     

    Believe there is no need to create a new sumarization table. Try the following steps:

     

    • Add a new table with the status (without any relationship to the other table)
    • Create the following two measure:
    Current = CALCULATE(COUNT('Values'[Column]);FILTER('Values';'Values'[Current Value]= SELECTEDVALUE('Status'[Status]))) + 0
    
    Previous = CALCULATE(COUNT('Values'[Column]);FILTER('Values';'Values'[Previous value]= SELECTEDVALUE('Status'[Status]))) + 0

     

    • Then  use this on your two visualizations

    Other option to go is:

    • Unpivot the Current Value and Previous value columns
    • Create a status table with relationship active to the first table
    • Create this two measures:
    CurrentUnpivot = CALCULATE(COUNT('Values (Unpivot)'[Column]);'Values (Unpivot)'[Type] = "Current value") + 0
    
    PreviousUnpivot = CALCULATE(COUNT('Values (Unpivot)'[Column]);'Values (Unpivot)'[Type] = "Previous value") + 0
    • Create your visualizations normally.

    Check PBIX file attach.