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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Employee
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
Employee
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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors