Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
9 | |
8 | |
8 | |
7 |
User | Count |
---|---|
13 | |
12 | |
11 | |
11 | |
8 |