Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I illustrated in excel below I need changed in my power bi file.
Currently I calculate workdays with the following calc: Workday = IF(WEEKDAY([Date],2)>5,0,1)
To get running total workdays:
RWkday = CALCULATE(SUM('Date'[Workday]),FILTER(ALL('Date'),'Date'[MYR]=EARLIER('Date'[MYR])&&'Date'[Date].[Day]<=EARLIER('Date'[Date].[Day])))
To get total workdays in month:
MWkday = CALCULATE(MAX('Date'[RWkday]),FILTER(ALL('Date'),'Date'[MYR]=EARLIER('Date'[MYR])))
MYR is just Month Year
So Above, Avg Sales by Business days is: Sales/RWKday (Business Days)
Run Rate is: Avg Sales by Business Days * MWkday (total business days in month)
The photo above is an example of looking at a month in process. So in December there have been a total of 8 business days so far. The date connected to when a sale occurs is a transaction date. Not every day does a vendor have a transaction so I have created a calendar table that has a relationship with the transaction date. The reason why there is a 3 for Vendor C and a 6 for Vendor D for business days so far (RWkday) is because those vendors must have only had 3 and 6 days in the month that actually had a transaction date. I would like the running business days RWkday to be agnostic of how many transaction dates a vendor may have in a month.
In yellow is what I would like to change my Power BI file to correctly calculate. So as you can see Vendor C and Vendor D would have 8 business days in total so far regardless of there 3 and 6 transaction dates that have happened.
What have I done wrong here, or what can I change to get the desired 8 business days for every vendor regardless of # of transaction dates??
Thank you so much in advance, I've worked on this so much that I'm unable to look at this in a new way.
HI @Anonymous,
Can you please provide some sample data to test?
Regards,
Xiaoxin Sheng
User | Count |
---|---|
74 | |
71 | |
42 | |
31 | |
28 |
User | Count |
---|---|
99 | |
93 | |
50 | |
49 | |
46 |