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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Number of WD left in any period...month

Hi Expert

 

I have the following DAX measure - which shoul dgive me the number of days left in any given month if the period is iin the past then zero. if current month and future day then work out how many days left in those period... but cannot see error

 

Workdays Left in Month = IF(INT(EOMONTH(TODAY(),0) - TODAY())<TODAY(),BLANK(),INT(EOMONTH(TODAY(),0) - TODAY()))
1 ACCEPTED SOLUTION
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

 

If you have a model like it in the attachment. You can try this formula.

Measure =
IF (
    EOMONTH ( MIN ( 'Calendar'[Date] ), 0 ) <= EOMONTH ( TODAY (), -1 ),
    9999,
    IF (
        TODAY () IN VALUES ( 'Calendar'[Date] ),
        DATEDIFF ( TODAY (), EOMONTH ( TODAY (), 0 ), DAY ),
        DAY ( EOMONTH ( MIN ( 'Calendar'[Date] ), 0 ) )
    )
)

Number_of_WD_left_in_any_period_month

Best Regards,
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

 

If you have a model like it in the attachment. You can try this formula.

Measure =
IF (
    EOMONTH ( MIN ( 'Calendar'[Date] ), 0 ) <= EOMONTH ( TODAY (), -1 ),
    9999,
    IF (
        TODAY () IN VALUES ( 'Calendar'[Date] ),
        DATEDIFF ( TODAY (), EOMONTH ( TODAY (), 0 ), DAY ),
        DAY ( EOMONTH ( MIN ( 'Calendar'[Date] ), 0 ) )
    )
)

Number_of_WD_left_in_any_period_month

Best Regards,
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Thanks Dale let me test. Measure.

Helpful resources

Announcements
ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.