Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Grace1
Helper II
Helper II

Budget vs Actual by cumulative by !Q, 2Q, ,1H, 3Q, 4Q, Full Year

Hi 

 

I have below sample reports budget and actual by mth and requrie to output report by quarter.

Appreciate any advice. Thanks.BudgetBudgetActualActualReportReport

 

 

 

3 ACCEPTED SOLUTIONS
Icey
Community Support
Community Support

Hi @Grace1 ,

 

Please check if this could meet your requirement:

 

1. Connect to Excel file.

 

In Power Query Editor,

2. Transform data of both Actual and Budget tables:

  1.  Remove button 1 row (total row).
  2.  Remove column "Total".
  3.  Select "Column1" and "Type" columns, then unpivot other columns.
  4.  Rename columns.

 

3. Merge queries as new.

merge.PNG

 

4. Expand table.

expand.PNG

 

5. Add conditional column.

cond.PNG

 

6. Filter rows.

filter.jpg

 

7. Remove column "Month.1" and "Month eq Month.1".

 

8. Rename column "Budget.1" with "Budget".

 

9. Add conditional column.

condi.PNG

 

10. Change type of "MonthNum" column.

 

11. Close and Apply.

 

In Power BI Desktop,

12. Create a Calendar table.

Calendar = 
ADDCOLUMNS (
    CALENDAR ( DATE ( 2019, 1, 1 ), DATE ( 2019, 12, 31 ) ),
    "Year", YEAR ( [Date] ),
    "Month", MONTH ( [Date] ),
    "Quarter", QUARTER ( [Date] )
)

 

13. Create relationship.

rela.PNG

 

14. Create columns in Calendar table.

Q = SWITCH ( 'Calendar'[Quarter], 1, "1Q", 2, "2Q", 3, "3Q", 4, "4Q" )
Half Year = SWITCH('Calendar'[Quarter],1,"1H",2,"1H",3,"2H",4,"2H")

 

15. Create a Measure.

Banlance = SUM('Actual & Budget'[Actual])-SUM('Actual & Budget'[Budget])

 

16. Create a Matrix visual.

matrix.PNG

total.PNG

total2.PNG

 

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.

View solution in original post

Icey
Community Support
Community Support

Hi @Grace1 ,

 

Try to create a [MonthNum] column and then sort your [Month] column by it.

 

Reference: 

Sort By Month Names In Power BI;

Power BI Tips: Sort by Month Name.

 

 

Best Regards,

Icey

View solution in original post

11 REPLIES 11

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.