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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
DimaMD
Solution Sage
Solution Sage

Сalculate the number of days in a week for the last month

Hello Community
My task is the following, I have the current month of September, I need to count the number of days of the week (Mondays, Tuesdays, Wednesdays, Thursdays, etc.)
My calculation measure for the current month is :

 

 

DaysInWeek = 
    CALCULATE(
    COUNTROWS('Dates'), 
    'Dates'[Number_month] = MONTH(TODAY()))

 

 

 I am interested in what will be the measure for calculating these days for the previous month
When I add -1 to MONTH(TODAY()) -1 it doesn't give me the desired result.
Help to understand how to calculate it.


__________________________________________

Thank you for your like and decision

__________________________________________

Greetings from Ukraine

To help me grow PayPal: embirddima@gmail.com
1 ACCEPTED SOLUTION
DimaMD
Solution Sage
Solution Sage

I managed to write a measure that gives me my desired result. I am attaching the file for further reference

DimaMD_0-1695553609096.png

 


__________________________________________

Thank you for your like and decision

__________________________________________

Greetings from Ukraine

To help me grow PayPal: embirddima@gmail.com

View solution in original post

3 REPLIES 3
DimaMD
Solution Sage
Solution Sage

I managed to write a measure that gives me my desired result. I am attaching the file for further reference

DimaMD_0-1695553609096.png

 


__________________________________________

Thank you for your like and decision

__________________________________________

Greetings from Ukraine

To help me grow PayPal: embirddima@gmail.com
ChiragGarg2512
Super User
Super User

Hello @DimaMD, I am unable to understand the issue.

ChiragGarg2512_0-1695393605163.png

I downloaded the file attachment and the dax was working correctly and giving the number of days in Month(Today()) - 1, i.e., August. 

Hi, @ChiragGarg2512  This is how it works if there is no date slicer, I incorrectly indicated the essence of the calculation, my task is to show the number of days of the week when choosing the minimum and maximum date in the slicer, the measure should show the number of the past month.
I managed to write such an event, but for some reason it does not work

DimaMD_0-1695548345569.png

 


__________________________________________

Thank you for your like and decision

__________________________________________

Greetings from Ukraine

To help me grow PayPal: embirddima@gmail.com

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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

Top Kudoed Authors