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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
KG1
Resolver I
Resolver I

Measure Interpretation

Hi

 

I am working on a dashboard that has been developed by someone else

 

I am struggling to breakdown this measure and what it is actually doing

 

= CALCULATE(COUNTA('Export'[Order]),DATESBETWEEN('Export'[Actual_Finish_date],max('Export'[Actual_Finish_date])-weekday(max('Export'[Actual_Finish_date]),3),max('Export'[Actual_Finish_date])))

 

Can someone please assist?

 

Thank you in advance

1 ACCEPTED SOLUTION

Its easier to read if its properly formatted

CALCULATE (
    COUNTA ( 'Export'[Order] ),
    DATESBETWEEN (
        'Export'[Actual_Finish_date],
        MAX ( 'Export'[Actual_Finish_date] )
            - WEEKDAY ( MAX ( 'Export'[Actual_Finish_date] ), 3 ),
        MAX ( 'Export'[Actual_Finish_date] )
    )
)

So 

MAX ( 'Export'[Actual_Finish_date] )
     - WEEKDAY ( MAX ( 'Export'[Actual_Finish_date] ), 3 )

gives the Monday of the relevant date. Using that as a parameter to DATESBETWEEN it is counting the number of orders within that week.

View solution in original post

3 REPLIES 3
johnt75
Super User
Super User

I think its counting the number of orders in a given week, starting from the Monday

What is the purpose of this part of the measure? weekday(max('Export'[Actual_Finish_date]),3), ?

 

Thank you

Its easier to read if its properly formatted

CALCULATE (
    COUNTA ( 'Export'[Order] ),
    DATESBETWEEN (
        'Export'[Actual_Finish_date],
        MAX ( 'Export'[Actual_Finish_date] )
            - WEEKDAY ( MAX ( 'Export'[Actual_Finish_date] ), 3 ),
        MAX ( 'Export'[Actual_Finish_date] )
    )
)

So 

MAX ( 'Export'[Actual_Finish_date] )
     - WEEKDAY ( MAX ( 'Export'[Actual_Finish_date] ), 3 )

gives the Monday of the relevant date. Using that as a parameter to DATESBETWEEN it is counting the number of orders within that week.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.