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.
Hi all,
I need help to the following task. the data is about order delivery Postponing. some orders are postponed several times (Postponing round). Some are postponed on the delivery date. I am trying to filter two things. first: how many orders positions were postponed yesterday. second: howmany of them were postponed on the same delivery date or the new delivery date?
At the end I should see a visual like this:
Thank you in Advance for your help.
order Number | Order Position | Postponing round | Postponing date | delivery date | New Delivery date |
1001 | 10 | 0 | 03.02.2025 | 13.02.2025 | 19.02.2025 |
1001 | 10 | 1 | 07.02.2025 | 13.02.2025 | 25.02.2025 |
1001 | 10 | 2 | 24.02.2025 | 13.02.2025 | 11.03.2025 |
1001 | 10 | 3 | 27.02.2025 | 13.02.2025 | 20.03.2025 |
1001 | 10 | 4 | 19.03.2025 | 13.02.2025 | 03.04.2025 |
1002 | 10 | 0 | 06.01.2025 | 10.01.2025 | 28.01.2025 |
1002 | 10 | 1 | 17.01.2025 | 10.01.2025 | 25.02.2025 |
1002 | 10 | 2 | 19.02.2025 | 10.01.2025 | 14.03.2025 |
1002 | 10 | 3 | 11.03.2025 | 10.01.2025 | 19.03.2025 |
1002 | 10 | 4 | 19.03.2025 | 10.01.2025 | 21.03.2025 |
1003 | 10 | 0 | 19.03.2025 | 28.04.2025 | 16.05.2025 |
1004 | 20 | 0 | 13.02.2025 | 14.02.2025 | 05.03.2025 |
1004 | 20 | 1 | 04.03.2025 | 14.02.2025 | 14.03.2025 |
1004 | 20 | 2 | 13.03.2025 | 14.02.2025 | 20.03.2025 |
1004 | 20 | 3 | 19.03.2025 | 14.02.2025 | 27.03.2025 |
1005 | 10 | 0 | 19.03.2025 | 13.05.2025 | 02.06.2025 |
1005 | 30 | 0 | 19.03.2025 | 13.05.2025 | 02.06.2025 |
1005 | 50 | 0 | 19.03.2025 | 13.05.2025 | 02.06.2025 |
1006 | 61 | 0 | 19.03.2025 | 01.04.2025 | 09.04.2025 |
1007 | 10 | 0 | 03.03.2025 | 12.03.2025 | 20.03.2025 |
1007 | 10 | 1 | 19.03.2025 | 12.03.2025 | 25.03.2025 |
1008 | 10 | 0 | 19.03.2025 | 21.03.2025 | 31.03.2025 |
1009 | 660 | 0 | 19.03.2025 | 20.03.2025 | 07.04.2025 |
1010 | 20 | 0 | 19.03.2025 | 20.03.2025 | 07.04.2025 |
1011 | 10 | 0 | 19.03.2025 | 24.03.2025 | 28.03.2025 |
Solved! Go to Solution.
Hi @Fish83,
Thanks for posting your query in Microsoft fabric community forum.
I’ve reproduced your scenario and created a step-by-step guide to filter postponed orders and visualize them as you described. Below is the solution using Power BI and DAX to meet your requirements.
You can use the following DAX measures in Power BI to achieve your goal:
TotalPostponed =
CALCULATE(
COUNTROWS('Table'),
'Table'[Postponing Date] = DATE(2025, 3, 19)
)
Calculated Column:
IsPostponedOnDeliveryOrNew =
IF(
OR(
'Table'[Postponing Date] = 'Table'[Delivery Date],
'Table'[Postponing Date] = 'Table'[New Delivery Date]
),
1,
0
)
PostponedOnDeliveryOrNew =
CALCULATE(
SUM('Table'[IsPostponedOnDeliveryOrNew]),
'Table'[Postponing Date] = DATE(2025, 3, 19)
)
I have attached the Power BI (.pbix) file and a sample screenshot for your reference. You can modify the file based on your dataset:
I trust this information proves useful. If it does, kindly “Accept it as a solution” and give it a 'Kudos' to help others locate it easily.
Thank you.
Hi @Fish83,
May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.
Thank you.
Hi @Fish83,
Thanks for posting your query in Microsoft fabric community forum.
I’ve reproduced your scenario and created a step-by-step guide to filter postponed orders and visualize them as you described. Below is the solution using Power BI and DAX to meet your requirements.
You can use the following DAX measures in Power BI to achieve your goal:
TotalPostponed =
CALCULATE(
COUNTROWS('Table'),
'Table'[Postponing Date] = DATE(2025, 3, 19)
)
Calculated Column:
IsPostponedOnDeliveryOrNew =
IF(
OR(
'Table'[Postponing Date] = 'Table'[Delivery Date],
'Table'[Postponing Date] = 'Table'[New Delivery Date]
),
1,
0
)
PostponedOnDeliveryOrNew =
CALCULATE(
SUM('Table'[IsPostponedOnDeliveryOrNew]),
'Table'[Postponing Date] = DATE(2025, 3, 19)
)
I have attached the Power BI (.pbix) file and a sample screenshot for your reference. You can modify the file based on your dataset:
I trust this information proves useful. If it does, kindly “Accept it as a solution” and give it a 'Kudos' to help others locate it easily.
Thank you.
Thank you very much for your help, and applogies for not replying quickly 😊.
@Fish83 Create a new measure to count the number of orders postponed yesterday.
Create another measure to count the number of orders postponed on the same delivery date or the new delivery date
DAX
PostponedYesterday =
VAR Yesterday = TODAY() - 1
RETURN
COUNTROWS(
FILTER(
'Table',
'Table'[Postponing date] = Yesterday
)
)
PostponedOnDeliveryDate =
VAR Yesterday = TODAY() - 1
RETURN
COUNTROWS(
FILTER(
'Table',
'Table'[Postponing date] = Yesterday &&
(
'Table'[Postponing date] = 'Table'[delivery date] ||
'Table'[Postponing date] = 'Table'[New Delivery date]
)
)
)
Create a visual (e.g., a card or a table) to display these measures.
Proud to be a Super User! |
|