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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
RPAI2812
Helper I
Helper I

Showing data with date in between initial and enddate

I have some data which each row is a initiative with INITIALDATE and ENDDATE columns. 

I also have a calendar table which I create a relationship with INITIALDATE at the moment.

However, I wanted to have a solution which in a YEAR slicer, if I select any year that is between the INITIALDATE and ENDDATE, the initiative still appears in the visual.

 

For example, Initiative 1 has:

INITIALDATE = 01/01/2020

ENDDATE = 31/12/2023

 

I wanted the initiative 1 to appear if I select any of the following years: 2020, 2021, 2022 and 2023.

 

Rgs

1 ACCEPTED SOLUTION
moizsherwani
Continued Contributor
Continued Contributor

Hi @RPAI2812 

 

In this case you actually need to disconnect the link between the calendar table and your fact (data) table and then use measures to show and hide the initiatives as below. Put a visual filter on the table with "IniativeShow = 1"

 

InitativeShow = 
VAR SelectedYear =
    SELECTEDVALUE ( 'Calendar'[Year] )
RETURN
    CALCULATE (
        COUNTROWS ( 'Table' ),
        FILTER (
            'Table',
            SelectedYear >= YEAR ( 'Table'[Initial Date] )
                && SelectedYear <= YEAR ( 'Table'[End Date] )
        )
    )

moizsherwani_1-1647787648592.png

 

moizsherwani_0-1647787629120.png

 (I have also attached the file for your reference) 

Thanks,

Moiz
Was I able to answer your question? Mark my post as a solution to help others. Kudos if you liked the solution.

View solution in original post

2 REPLIES 2
RPAI2812
Helper I
Helper I

@moizsherwani 

Thank you for the reply, it solved my issue.

Now if you could give an extra help.. imagine I have a column with some savings from this initiative.

How to filter a SUM or AVERAGE measure with Initiativeshow = 1?

I tried to apply with calculate or filter, but could not manage 😞

moizsherwani
Continued Contributor
Continued Contributor

Hi @RPAI2812 

 

In this case you actually need to disconnect the link between the calendar table and your fact (data) table and then use measures to show and hide the initiatives as below. Put a visual filter on the table with "IniativeShow = 1"

 

InitativeShow = 
VAR SelectedYear =
    SELECTEDVALUE ( 'Calendar'[Year] )
RETURN
    CALCULATE (
        COUNTROWS ( 'Table' ),
        FILTER (
            'Table',
            SelectedYear >= YEAR ( 'Table'[Initial Date] )
                && SelectedYear <= YEAR ( 'Table'[End Date] )
        )
    )

moizsherwani_1-1647787648592.png

 

moizsherwani_0-1647787629120.png

 (I have also attached the file for your reference) 

Thanks,

Moiz
Was I able to answer your question? Mark my post as a solution to help others. Kudos if you liked the solution.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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.