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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
joshua1990
Post Prodigy
Post Prodigy

Calculate MAX Status per Sales Order for Selected Day

Hello all,

I am currently trying to develop a report that shows how many open sales order there were for a given day/period.

As visualization I would like to use a simple bar chart, which shows how many open sales orders there were for the respective day / week.
The structure of the data is as follows:

Sales OrderValueStatusDate
100150101.01.2022
100160602.01.2022
100260603.01.2022

 

Open sales requisitions have a status < 6.
How can I find out how many orders had a status <6 for the respective period?

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

@joshua1990 

The following code is more simple

Open Sales =
CALCULATE (
    DISTINCTCOUNT ( Table[Sales] ),
    REMOVEFILTERS ( 'Calendar' ),
    Table[Date] <= MAX ( 'Calendar'[Date] ),
    Table[Status] < 6
)

View solution in original post

5 REPLIES 5
tamerj1
Super User
Super User

@joshua1990 

The following code is more simple

Open Sales =
CALCULATE (
    DISTINCTCOUNT ( Table[Sales] ),
    REMOVEFILTERS ( 'Calendar' ),
    Table[Date] <= MAX ( 'Calendar'[Date] ),
    Table[Status] < 6
)
tamerj1
Super User
Super User

Hello again

In case you are using the date column from the same table in the visual then you can try

Open Sales =
CALCULATE ( DISTINCTCOUNT ( Table[Sales] ), FILTER ( ALL ( Table ), Table[Date] <= MAX(Table[Date]) && Table [Status] < 6 ))

tamerj1
Super User
Super User

Hi @joshua1990 
do you have date table? Any relationships?

@tamerj1 : Yes, I have a calendar table.

Then please try

Open Sales =
CALCULATE ( DISTINCTCOUNT ( Table[Sales] ), REMOVEFILTERS('Calendar'), FILTER ( ALL ( Table ), Table[Date] <= MAX('Calendar'[Date]) && Table [Status] < 6 ))

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.