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 everyone,
I am struggling with some DAX and would really appreciate some assistance. This is the trickiest issue I have ever had to solve!
I have a table as above with a bunch of order date and order stage changes for an order. For each order date change entry is the number of days that the order was changed by each time. For each stage (A,B,C,D,E,F) I need to calculate the number of days and times that the order was changed during that stage. For example, the stage was changed to D, then the order date changed twice, totaling 21 days during that stage. Then the stage was changed to stage E, where it changed 15 times totaling 239 days.
Can split these entries into more columns if need be.
Thank you in advance to anyone who can solve this problem!
you can count days between 2 different dates with
DATEDIFF(Date1;Date2;Interval)
like:
DATEDIFF('Table1'[ColumsWithFirstDate];'Table1'[ColumsWithSecondDate];DAY)
or
DATEDIFF('Table1'[ColumsWithFirstDate];TODAY();DAY)
I assume you have a unique order number to which you assign your stages, dates and changes?
To record the number of canges I would suggest a variable that increases with each change as it is described here: https://community.powerbi.com/t5/Desktop/Increment-variable-after-condition/td-p/663156
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 |
---|---|
47 | |
26 | |
19 | |
14 | |
10 |
User | Count |
---|---|
58 | |
50 | |
44 | |
19 | |
19 |