Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Khomotjo
Helper II
Helper II

Select A subset

Hello  Everyone,

 

I am struggling to do the following in  Power BI :

For a given date:

  • Filter all data with a date less than the current date by a day or 2 days if the Date is a Monday;
  • Count all orders that  are open.

 

I tried this :

Today Orders =
VAR Current = TRUNC(MAX(Orders[Date]))
RETURN
 CALCULATE(
    COUNT(Orders[Reference]),
    FILTER(Orders,TRUNC(Orders[Required Date])=TRUNC(Current+1) && Orders[Status] <> "Departed")
)

Below is a view of what my data looks like for 2 dates:


ReferenceStatusProduct CountLine UnitsCreated TimeFinalised DateRequired DateMovement DateAnalysis DateDatePrevious_DayExports
1Departed1203 Feb 2523 Feb 2524 Feb 2523 Feb 2524 Feb 2524 Feb 2523 Feb 25National
2Departed1203 Feb 2523 Feb 2524 Feb 2523 Feb 2524 Feb 2524 Feb 2523 Feb 25National
3Departed1203 Feb 2523 Feb 2524 Feb 2523 Feb 2524 Feb 2524 Feb 2523 Feb 25National
4Departed1203 Feb 2523 Feb 2524 Feb 2523 Feb 2524 Feb 2524 Feb 2523 Feb 25National
5Departed1203 Feb 2523 Feb 2524 Feb 2523 Feb 2524 Feb 2524 Feb 2523 Feb 25National
6Departed1203 Feb 2523 Feb 2503 Feb 2523 Feb 2524 Feb 2524 Feb 2523 Feb 25National
7Departed1203 Feb 2523 Feb 2503 Feb 2523 Feb 2524 Feb 2524 Feb 2523 Feb 25National
8Departed1203 Feb 2523 Feb 2503 Feb 2523 Feb 2524 Feb 2524 Feb 2523 Feb 25National
9Departed1203 Feb 2524 Feb 2527 Feb 2524 Feb 2525 Feb 2525 Feb 2524 Feb 25National
10Departed1203 Feb 2524 Feb 2528 Feb 2524 Feb 2525 Feb 2525 Feb 2524 Feb 25National
11Departed1203 Feb 2524 Feb 2503 Feb 2524 Feb 2525 Feb 2525 Feb 2524 Feb 25National
12Departed1203 Feb 2524 Feb 2503 Feb 2524 Feb 2525 Feb 2525 Feb 2524 Feb 25National
13Departed1203 Feb 2524 Feb 2525 Feb 2524 Feb 2525 Feb 2525 Feb 2524 Feb 25National
14Departed1203 Feb 2524 Feb 2525 Feb 2524 Feb 2525 Feb 2525 Feb 2524 Feb 25National
15Departed1203 Feb 2524 Feb 2525 Feb 2524 Feb 2525 Feb 2525 Feb 2524 Feb 25National
16Departed1203 Feb 2524 Feb 2525 Feb 2524 Feb 2525 Feb 2525 Feb 2524 Feb 25National
17Departed1204 Feb 2524 Feb 2525 Feb 2524 Feb 2525 Feb 2525 Feb 2524 Feb 25National
18Departed1205 Feb 2524 Feb 2525 Feb 2524 Feb 2525 Feb 2525 Feb 2524 Feb 25National
1 REPLY 1
ryan_mayu
Super User
Super User

Is this a table visual or your raw data? if it's a table visual, pls provide some raw data and what's the expected output based on the sample data you provided?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.