cancel
Showing results for
Did you mean:

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

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
Solution Sage

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

__________________________________________

Thank you for your like and decision

__________________________________________

Greetings from Ukraine

To help me grow PayPal: embirddima@gmail.com
3 REPLIES 3
Solution Sage

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

__________________________________________

Thank you for your like and decision

__________________________________________

Greetings from Ukraine

To help me grow PayPal: embirddima@gmail.com
Impactful Individual

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

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

Solution Sage

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

__________________________________________

Thank you for your like and decision

__________________________________________

Greetings from Ukraine

To help me grow PayPal: embirddima@gmail.com

Announcements

#### Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

#### Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

#### Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

#### The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors