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.
Hi All,
I have two facttables in my tabular model; sales and budget, which do not have the same granularity.
My sales on a day level, and my budget on a monthly basis. I would like to split my monthly budget into week days.
I have tried follow SQLBI's budget patterns, but I can not get it to work - link: http://www.daxpatterns.com/budget-patterns/
In my fact sales fact look like this:
NB - Sales for each day in the month.
And my budget fact look like this:
NB - Budget for the first day of the month, e.g. 1st Maj 2017 and 1st June 2017.
Both fact have a relation to my calendar, which have the following attributes:
I would like to create dax formel that SPILT THE MONTHLY BUDGET INTO WEEKDAYS.
If the calendar IS filtered/drilled down to days; I would like to see budget on monday-friday, and no budget on saturday and Sunday.
Based on SQLBI's blog post I have managed to calculate the number of week days for each month by using this:
SUMX ( VALUES ( '02 Calendar'[CalendarID] ), CALCULATE ( COUNTROWS ( '02 Calendar' ), '02 Calendar'[Is Week Day] = 1 ) / CALCULATE ( COUNTROWS ( '02 Calendar' ), ALLEXCEPT ( '02 Calendar', '02 Calendar'[CalendarID] ), '02 Calendar'[Is Week Day] = 1 ) )
By dividing the budget with the above:
DIVIDE([AmountBUDX], SUMX ( VALUES ( '02 Calendar'[CalendarID] ), CALCULATE ( COUNTROWS ( '02 Calendar' ), '02 Calendar'[Is Week Day] = 1 ) / CALCULATE ( COUNTROWS ( '02 Calendar' ), ALLEXCEPT ( '02 Calendar', '02 Calendar'[CalendarID] ), '02 Calendar'[Is Week Day] = 1 ) ) )
I am able the get the budget per day.
In Excel it is shown as below:
And on a day level:
However, I can not figure out how I get this shown on the day level?
Can anyone help me?
NB - I have a relation for both my sales and my budget fact to the calendar dimension, by using the field CalendarID
I have created a simple PBI model with the calendar dimension, fact sales, and fact budget.
Link to file: https://www.dropbox.com/s/fkge885z25rs4f2/budget%20split%20into%20days.pbix?dl=0
Can someone help?
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
120 | |
103 | |
87 | |
68 |