Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

matrix Visual-Totals in left

Hi All,

 

I have one requirement to create a matrix which shows the total in left.Plaese refer attached mock report sheet.I have tried all possible ways but no hope.

 

Can anyone help me on this.

 

Thanks,

Nitin

11 Replies

  • Anonymous you should able to achieve by following:

     

    - add first column on rows

    - add divison column on columns

    - assuming you have two measures, one for the current year and one for prev year, add these two measures on value

     

     

     

     

  • Icey's avatar
    Icey
    Icon for Community Support rankCommunity Support

    Hi Anonymous ,

     

    Power BI doesn't support to set "Total" to left currently.

    Here is a similar idea which you could vote it up: Move Sub-Total and Total columns to left side.

     

    One workaround, you can create your Measures like so:

    1. Fact Table: 

     

    2. Enter a table:

     

    3. Create Measures.

     

    Current Year = SUM('Table'[Value])
    Last Year =
    VAR ThisYear =
        MAX ( 'Table'[Year] )
    RETURN
        CALCULATE ( SUM ( 'Table'[Value] ), 'Table'[Year] = ThisYear - 1 )
    
    Measure = 
    VAR ThisYear =
        IF (
            MAX ( 'Year & Measure'[Year] ) <> "All Years",
            VALUE ( MAX ( 'Year & Measure'[Year] ) )
        )
    RETURN
        SWITCH (
            TRUE (),
            MAX ( 'Year & Measure'[Year] ) = "All Years"
                && MAX ( 'Year & Measure'[MeasureName] ) = "Current Year", [Current Year],
            MAX ( 'Year & Measure'[Year] ) = "All Years"
                && MAX ( 'Year & Measure'[MeasureName] ) = "Last Year", [Last Year],
            VALUE ( MAX ( 'Year & Measure'[Year] ) ) IN VALUES ( 'Table'[Year] )
                && MAX ( 'Year & Measure'[MeasureName] ) = "Current Year", CALCULATE ( [Current Year], 'Table'[Year] = ThisYear ),
            VALUE ( MAX ( 'Year & Measure'[Year] ) ) IN VALUES ( 'Table'[Year] )
                && MAX ( 'Year & Measure'[MeasureName] ) = "Last Year", CALCULATE ( [Last Year], 'Table'[Year] = ThisYear )
        )

     

     

    4. Create a Matrix visual.

     

    For more details, please check the attached PBIX file.

     

     

    Best Regards,

    Icey

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Icey's avatar
    Icey
    Icon for Community Support rankCommunity Support

    Hi Anonymous ,

     

    Can the workaround I provided meet your requirements?

     

     

    Best Regards,

    Icey

    • Anonymous's avatar
      Anonymous
      Not applicable

      I hvae tried ur solution.But it works fine wenver we have one mesaure ,In my case I have 3 measures.In matrix its showing 3 layers

      • Icey's avatar
        Icey
        Icon for Community Support rankCommunity Support

        Hi Anonymous ,

         

        If you don't mind, share me a dummy PBIX file, removing sensitive information, and I will conduct specific tests to see if it can be achieved.

         

         

        Best Regards,

        Icey