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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.