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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
RavChop
Regular Visitor

Return columns when the to and from dates fall between the current date

Hi, I'm quite the PowerBI amateur but I was trying to create a measure that does the following. 

 

I want to display the current weeks reporting week when the effective from date is greater than or equal to todays date, and the effective to date is less than or equal to todays date. 

 

I have created the following measure 

 

 

Current Reporting Week = 
IF (
    VALUES ( recco_mscreportingweek[recco_effectivefrom] ) >= TODAY ()
        && VALUES ( recco_mscreportingweek[recco_effectiveto] ) <= TODAY (),
    true,
    false
)

 

 

But what I want to do is return the reporting week column if the statement above is true. 

 

A measure may not be the way to go, so any help at all will be appreciated. 

Thank you. 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@RavChop , you can have a column like

 

Current Reporting Week =
IF (
( recco_mscreportingweek[recco_effectivefrom] ) >= TODAY ()
&& ( recco_mscreportingweek[recco_effectiveto] ) <= TODAY (),
recco_mscreportingweek[reporting week],
blank()
)

 

or create a measure

 

Current Reporting Week =
countrows(Filter(recco_mscreportingweek, IF (
VALUES ( recco_mscreportingweek[recco_effectivefrom] ) >= TODAY ()
&& VALUES ( recco_mscreportingweek[recco_effectiveto] ) <= TODAY (),
true(),
false()
)))

 

use with reporting week

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

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@RavChop , you can have a column like

 

Current Reporting Week =
IF (
( recco_mscreportingweek[recco_effectivefrom] ) >= TODAY ()
&& ( recco_mscreportingweek[recco_effectiveto] ) <= TODAY (),
recco_mscreportingweek[reporting week],
blank()
)

 

or create a measure

 

Current Reporting Week =
countrows(Filter(recco_mscreportingweek, IF (
VALUES ( recco_mscreportingweek[recco_effectivefrom] ) >= TODAY ()
&& VALUES ( recco_mscreportingweek[recco_effectiveto] ) <= TODAY (),
true(),
false()
)))

 

use with reporting week

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

I tried creating a column, however, when I try to use that column in a visual there seems to be no data. I have checked to ensure I have date that falls between the date range of effective from and effective to, but the visual is still blank. 

Apologies, I realise my condition was wrong and needed to swap around the >=, this has worked really well, thank you! 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors