The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello guys,
I have to tables of data with open orders by our clients cleaned up and imported to the data model. Both tables have a columns with order file number and the corresponding weight (we're a logistics company) of all the containers comprising the order. I'd like to report on the total weight of new orders this week as compared to the data last week, i.e., find out which order numbers did not appear in last week's table and sum the corresponding weights of these new orders. As i'm pretty new to DAX I do not know how to do this in Power BI.
Anyone know how to find out the total weight on the new orders based on comparing order file numbers? Greetings
Thank you for responding guys, however this is not what i am looking for. I'll try to simplify my question.
Anyone know how to this in an elegant way? Thanks in advance
Nobody?
In Power query, there is Date.IsInCurrentWeek functin that returns a logical value indicating whether the given Date/DateTime/DateTimeZone occurred during the current week, as determined by the current date and time on the system.
To check if the date is in previous week, there is no such a function to achieve this directly. You need to return the week number and previous week number, and check if the week number=previous week number. We can use Date.WeekOfYear function in Power query to get the week number. Add a custom Column:
= Table.AddColumn(#"YourPreviousStep", "LastWeek", each if Date.IsInPreviousWeek([Date]) then "Yes" else "No")
Finally, you can use DAX to calculate the total weight of a new order
Try something like this as a measure:
User | Count |
---|---|
77 | |
76 | |
36 | |
31 | |
29 |
User | Count |
---|---|
93 | |
79 | |
57 | |
48 | |
48 |