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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
mwvoves
Regular Visitor

Date slicer not impacting measure

In one of my datasets, I'm using  a measure to see how many weekend days there have been so far this period. On the actual UI page I have a slicer to select what period you'd like to look at, but the measure doesn't update- for example, when I select period 2, which started on 1/29, the measure should read a value of 1, since Sunday the 29th is the only weekend day thus far for period 2. Instead it reads a value of 9, which is the total number of weekend days so far this year. Any ideas on how to get the slicer to impact the measure below?

 

Weekend days = Calculate(
COUNT(PERIOD_VIEW[DAY_NAME]),
PERIOD_VIEW[Date]<TODAY(),
PERIOD_VIEW[YEAR]=2023,
OR(PERIOD_VIEW[DAY_NAME]="Sunday",PERIOD_VIEW[DAY_NAME]="Saturday"))
1 ACCEPTED SOLUTION
mwvoves
Regular Visitor

I was able to find a solution using the Selectedvalue function- below is an updated version of the code:

Weekend days = Calculate(
COUNT(PERIOD_VIEW[DAY_NAME]),
PERIOD_VIEW[Date]<TODAY(),
PERIOD_VIEW[YEAR]=2023,
PERIOD_VIEW[PERIOD_NUMBER]= SELECTEDVALUE(PERIOD_VIEW[PERIOD_NUMBER]),
OR(PERIOD_VIEW[DAY_NAME]="Sunday",PERIOD_VIEW[DAY_NAME]="Saturday")
)

View solution in original post

3 REPLIES 3
mwvoves
Regular Visitor

I was able to find a solution using the Selectedvalue function- below is an updated version of the code:

Weekend days = Calculate(
COUNT(PERIOD_VIEW[DAY_NAME]),
PERIOD_VIEW[Date]<TODAY(),
PERIOD_VIEW[YEAR]=2023,
PERIOD_VIEW[PERIOD_NUMBER]= SELECTEDVALUE(PERIOD_VIEW[PERIOD_NUMBER]),
OR(PERIOD_VIEW[DAY_NAME]="Sunday",PERIOD_VIEW[DAY_NAME]="Saturday")
)
amitchandak
Super User
Super User

@mwvoves , You need create a measure for date filter to work

 

example 

 

datediff(max(date[Date]), Today(),day) - networkdays(max(date[Date]), Today(),1)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

What is the "networkdays" function you have? I don't seem to have that in my BI

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.