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
DavidWaters100
Post Patron
Post Patron

Budget and actuals at different granularity

Hi,

I have the age-old problem with visuals looking at actuals and budgets which are at different levels of granularity.  I have tried looking at old posts about this but none seemed to have the extra complexity of a YTD and MTD switch.

 

Throughout my reports there is a YTD and MTD switch per below, using DATESMTD and DATESYTD. A calendar table is joined to a start date in the “actual” table and works fine. There are 3 main column types – Class, Subclass and Location for which budgets are measured.

 

My problem is trying to return the budget numbers against the 3 types when a visual is aggregating the actual table which has entries for every single day, but the budget table only has entries per month for each of the three types.  The measure for the budget also needs to respond to YTD or MTD but is only at month level. 

 

I have tried many solutions but can’t get this to work! Any help greatly appreciated.

 

Below is the YTD / MTD switch:

YTD MTD = switch(SELECTEDVALUE(Period[Period]),"YTD",[YTD],"One Month",[MTD])

YTD = Calculate(sum('Power BI'[start date]),DATESYTD('Calendar Table'[Date]))

MTD = Calculate(sum('Power BI'[start date]),DATESMTD('Calendar Table'[Date]))

Proud to be a Super User!
1 ACCEPTED SOLUTION
8 REPLIES 8
amitchandak
Super User
Super User

Can you convert month into a month start or month-end date like

 

Say month is - Jan-2020

 

Date = "01-" & [Month] // Change data type to date

Say month 2020-10

Date = date(year(left([Month],4)),month(right([Month],2)),1)

The start date has to have the relationship to calendar date as there are other metrics like week number (ie not month start only)

Proud to be a Super User!

If data is at the month level. Then the start date of the month should join with the date of the calendar.

 

Now as the calendar has all dates. It might end up showing data on the first data as well as the first week. That you take care while display not to show budget at day or week level. Another way is allocation at the day level

Refer

https://www.dropbox.com/s/fnq82ksdzk1lqs3/Target_allocation_daily.pbix?dl=0

The actual table is at date level, the budget table is at month level.  I have now posted a sample file to Excel online to show the content of each table

Proud to be a Super User!

Hi thanks for your solution - it works with the sample data but my table relationships are quite different from this basic sample data.  I don't think this solution will work for me without major changes...

Proud to be a Super User!
Greg_Deckler
Super User
Super User

Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Sorry here is link to sample data in Excel with expected results

 

https://1drv.ms/x/s!AgZEuf7Vkrdog3bOQu53BhWaLP59?e=VTiZbh

 

Password is Ruby100

Proud to be a Super User!

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.