Forum Discussion

Godislove22222's avatar
Godislove22222
Frequent Visitor
2 years ago
Solved

Consolidate rows and sum

Good day PowerBI Guru. 

Newbe here.  

My data has the following layout. 
Goal:  Remove "Line" by summing FY23, then FY 24 for each office.

Then caluate % Difference and have an icon or chart showing increase or decrease.

 

Data looks like this...

 

OfficeLineFY2023 PlanFY 2024 Plan% Difference% Difference Icon 
Office ALine 1100200  
Office ALine 2110105  
Office BLine 3120220  
Office CLine 2130230  
Need this...    
 FY2023 PlanFY 2024 Plan% DifferenceIcon 
Office A210305  
Office B120220  
Office C130230  
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Godislove22222 

    Based on the data you have provided, the value of sox com in 2023 is 0.

    so it will returen 0

     

    Best Regards!

    Yolo Zhu

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

     

     

8 Replies

    • Godislove22222's avatar
      Godislove22222
      Frequent Visitor

      Thank you!!!

      My issues is I have some values with zeros that is resulting in an error. 

       

      Please see attached is the file.

       

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Godislove22222 

    1.You can create a measure.

    Difference = DIVIDE(SUM('Table'[FY 2024 Plan])-SUM('Table'[FY2023 Plan]),SUM('Table'[FY2023 Plan]))

    2.Create a measure to set the icon.

    Format = if([Difference]>0,1,0)

    3.Put the following field to a matrix visual.

     

    4.Set the conditional formatting of the difference measure, select 'Icon'

    5.Set the rule.

     

    Output

    Best Regards!

    Yolo Zhu

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

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Godislove22222 

      Do you mean that you want to add a new column in the table to calculate the difference?

      If you want to achieve it, you can refer to the following calculated columns.

      Sum_2023 = SUMX(FILTER('Table',[CATEGORY]=EARLIER('Table'[CATEGORY])),[2023 PLAN])
      Sum_2024 = SUMX(FILTER('Table',[CATEGORY]=EARLIER('Table'[CATEGORY])),[2024 Plan])
      %Difference = DIVIDE([Sum_2024]-[Sum_2023],[Sum_2023])

      Output

      If you want to implement it by using measure,  you just put the CATEGORY to the row field to the matrix, and put the 2023 plan and 2024 plan to the value, it will automatic aggregate. then follow the soution I offered at 4th message to create the measure.

      Best Regards!

      Yolo Zhu

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

       

       

       

      • Godislove22222's avatar
        Godislove22222
        Frequent Visitor

        When I add the % Difference column to what you provided, I get the following.  Is this correct?  And lastly, the "SOX COM" had a zero plan in FY23 but a positive amount in FY24. Any suggestions for this one? 

         

         

  • CATEGORYLINE2023 PLAN2024 Plan
    MONEY3V134964112500
    ETRAVEL3V10108975817
    ORACLE3V1798866884543
    PRINTING3430600002718046
    PRINTING3606500000
    PRINTING310500000
    FUEL3T-24463600-15529604
    SMART P3T-723025-991778
    REVENUE3602344350
    REVENUE3V207006100000
    SOX COM3609430460
    ACCOUNT460300000
    ACCOUNT3V10374791106125
    OTHER R3V21712302099101
    PAYROLL3V13570191145400
    FUND3V4523441500
    TRAVEL3V11984296880
    TRAVEL341586016000
    RPA468941791300
    EMIN362850008047817
    AUDIT T6W02500
    AUDIT T3V58805104580
    CLAIMS34701950000
    CLAIMS3V759026993144
    TIMEATD3V12665511162000