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 am a new PBI user and would love some support on an issue I can't resolved (despite reading through similar Q&A posts)...
I have daily sales data loaded in my model, and am trying to calculate a simple average daily sales by weekday (* we only sell during Mon-Fri). I already have a "IsWorkingDay" column in my date table, and have attempted to create the following measure:
No of Sales Days Lapsed = CALCULATE( SUM('Date Dimension'[IsWorkingDay]), DATESBETWEEN('Date Dimension'[FullDate], STARTOFMONTH('Date Dimension'[FullDate]), LASTDATE(Sales[Invoice Date])))
This measure gives me an expected return value of "10" (i.e. I have sales loaded for 1 Oct 2019 to 14 Oct 2019, so that consisted of 10 weekdays in that period). But here is my problem..... when I add in a matrix of my sales broken down by customer, I am getting the following:
Customer | ACT Nett Sales | # of Sales Days Lapsed | # of Weekdays in Mth | Extrapolated Full Month Sales |
Customer #1 | $29,000 | 10 | 23 | $66,700 |
Customer #2 | $22,000 | 10 | 23 | $50,600 |
Customer #3 | $34,000 | 6 | 23 | $130,333 |
Customer #4 | $11,000 | 10 | 23 | $25,300 |
Customer #5 | $7,500 | 10 | 23 | $17,250 |
Customer #6 | $6,800 | 10 | 23 | $15,640 |
TOTAL | $110,300 | $305,823 |
The problem with Customer #3 is that unlike all other customers who purchased every weekday so far this month, he only purchased on 6 weekdays.
As I am now trying to extraplate my MTD sales to the full month, it is giving me a false/inflated estimate of my forecasted sales.
How do I modify my DAX so that my [No of Sales Days Lapsed] measure simply takes the latest date within my sales table, regardless of any attribute (e.g. customer, product type, store location, etc.),then minus the start of the month selected, and then work out the number of weekdays lapsed?
Many thanks in advance.
Anthony
Solved! Go to Solution.
No worries @Greg_Deckler . I will re-draft my data and submit again (* in the right format and forum).
Thanks.
First, 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.
Second, See if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.
https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...
Sorry @Greg_Deckler , new to PBI and this forum, so didn't mean to break the rules. I now realised that I posted to the wrong section, but have no idea how to edit (* might delete and re-post if required).
I did have a look at your link, but I must admit I do not understand how it can resolve my issue. I am pretty green at PBI, so can you please point me down to the right path?
As explained in my initial post, I can get it 99% right. The hurdle is when I dissect my sales data (e.g. by customer), and that my lapsed working days measure fail in instances where the customer did not buy every single weekday.
Thanks for your reply. Much apprecaited.
Oh, it's not so much about any rules but more about the fact that without some sample source data, it is incredibly difficult to replicate your issue and troubleshoot. That was the main point of referring you to the "How to" article.
No worries @Greg_Deckler . I will re-draft my data and submit again (* in the right format and forum).
Thanks.
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 |
---|---|
110 | |
99 | |
80 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
93 | |
84 | |
66 |