Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi All,
I'm trying to create a column that calculates the original due date for a set of items that have due dates that can be extended over and over again. For example, in this table, I want the "Original Due Date" column to look up the earliest date from the "Due Date" column based on the "Item" name (i.e. for the "Blue" Item, the original due date was 1/5/18, and for the "Red" Item, the original due date was 3/2/19).
Here is the formula I am trying:
Solved! Go to Solution.
@Anonymous
try
Original Due Date = CALCULATE ( MIN ( 'Table'[Due Date] ), ALLEXCEPT ( 'Table', 'Table'[Item] ) )
Dear rdcooper,
Is this you expected?
The DAX Expression i have used to get this as follows.
Measure_OrderDate = CALCULATE(MIN(PBI_Data[OrderDate]), ALLEXCEPT(PBI_Data,PBI_Data[Item]))
Regards,
Pradeep
You can use Groupby in PQ to get that figure pretty easily:
Using this formula it will only return the first date of my calender table. If I want to see the first sales date of my table this formula will not work. I need calculate the min date of the calender table when sales values in not blank. Can anyone help me on this.
Wow thank you so much @Zubair_Muhammad, @Anonymous, @Anonymous - can't believe it was that easy! I had actually found the similar solution @Zubair_Muhammad offered in an almost identical post to mine (here), but I didn't think "ALLEXCEPT" would make sense since the name of the function is counterintuitive - I would have thought that would have returned the earliest due date for all rows except the ones with the Item name I was interested in. Weirdly enough, it works though. Thanks again!
Dear rdcooper,
Is this you expected?
The DAX Expression i have used to get this as follows.
Measure_OrderDate = CALCULATE(MIN(PBI_Data[OrderDate]), ALLEXCEPT(PBI_Data,PBI_Data[Item]))
Regards,
Pradeep
And what if I have multiple types of binders (e.g. red, green) defined in an aditioanl column, and now we want to return all binders with first date (there might be 2). How to write function to retain both Binder green and binder red record:
| ITEM | COLOR | OrderDate | |
| Binder | Red | 2018-01-10 | |
| Binder | Green | 2018-01-10 | |
| Binder | Red | 2018-02-10 | |
| Binder | Red | 2018-03-10 | |
| Binder | Red | 2018-04-10 | |
| Binder | Red | 2018-05-10 |
@Anonymous
try
Original Due Date = CALCULATE ( MIN ( 'Table'[Due Date] ), ALLEXCEPT ( 'Table', 'Table'[Item] ) )
How to take this measure one step further by calculating when the Due Date = Origional Due Date, (Y/N or T/F)? Where to incert an if statment or a variable?
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.
| User | Count |
|---|---|
| 47 | |
| 43 | |
| 40 | |
| 20 | |
| 15 |
| User | Count |
|---|---|
| 70 | |
| 67 | |
| 32 | |
| 27 | |
| 25 |