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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount 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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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