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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
markefrody
Post Patron
Post Patron

Count Number of Past Days in Current Month Except Sundays

Hi,

 

Appreciate if you can help me with the following:

 

1.) Is there a DAX in counting the past number of days in the current month excluding today and Sundays?

 

2.) Is there a DAX to count the remaining days of the current month excluding today, Sundays, and past days.

 

Best regards,

Mark

2 REPLIES 2
MarcoPessina
Resolver IV
Resolver IV

Hi @markefrody ,

try these measures:

Days Before Today = CALCULATE(
    COUNTROWS('Date'),FILTER(
        'Date','Date'[Date]<TODAY() && MONTH('Date'[Date])=MONTH(TODAY()) && WEEKDAY('Date'[Date])<>7)
        )
Days After Today = CALCULATE(
    COUNTROWS('Date'),FILTER(
        'Date','Date'[Date]>TODAY() && MONTH('Date'[Date])=MONTH(TODAY()) && WEEKDAY('Date'[Date])<>7)
        )

 Hope it helps.

Cheers,

Marco

@MarcoPessina 

Hi Marco,

Thank  you for the measure. I have tried using it but the number of days are not computing properly. I have attached the sample data for your reference.

 

Sample data

 

Best regards,

Mark V

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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