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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
LiamNeufeld
New Member

Static Yearly Timelines

Hello, 

I have a sort of unique challenge that I am hoping to get some support on. I have a list of reporting deadlines which have static due dates. I would like to add these timelines to my PowerBI dashboard as a guideline for my team. The problem that I am facing is that some of the timelines extend slighly past the current year. For example a report is requested in September of 2023 but due by March 2024. This is a problem as I wanted to write a quick DAX query to go off of the current year but I cant seem to add or subtract a year to reflect these altered due dates. For context I have an excel sheet with the timelines that I am pulling into PowerBI then showing via a Gantt Chart. 

Any advice is welcome, I am fairly new to PowerBI and DAX so it is entirely possible that I am missing something. 

Thanks!

1 ACCEPTED SOLUTION

HI @LiamNeufeld,

I'd like to suggest you write a measure expression to check records and return flag, then use it on the 'visual level filter' to filter records who matched with conditions.

Sample formula: check the current report group of records if they include records that match with configured conditions.

Flag =
VAR msType = "Requested Date"
VAR YearFilter = 2024
VAR currDesc =
    SELECTEDVALUE ( Table1[Description] )
VAR List =
    CALCULATETABLE (
        VALUES ( Table1[Description] ),
        FILTER (
            ALLSELECTED ( Table1 ),
            [milestone] = msType
                && YEAR ( [Date] ) = YearFilter
        )
    )
RETURN
    IF ( currDesc IN List, "Y", "N" )

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

3 REPLIES 3
LiamNeufeld
New Member

Here is some dummy data, I split the chart into three columns one for milestones, one for description, and one for the date (Based off of the milestone). 

LiamNeufeld_0-1715094923310.png

The outliers occur when the dates extend past 2024. My initial thought was to write a dax query to just go off of the current year when viewing as these timelines are repeated yearly. However with the outliers this approach does not work. 

HI @LiamNeufeld,

I'd like to suggest you write a measure expression to check records and return flag, then use it on the 'visual level filter' to filter records who matched with conditions.

Sample formula: check the current report group of records if they include records that match with configured conditions.

Flag =
VAR msType = "Requested Date"
VAR YearFilter = 2024
VAR currDesc =
    SELECTEDVALUE ( Table1[Description] )
VAR List =
    CALCULATETABLE (
        VALUES ( Table1[Description] ),
        FILTER (
            ALLSELECTED ( Table1 ),
            [milestone] = msType
                && YEAR ( [Date] ) = YearFilter
        )
    )
RETURN
    IF ( currDesc IN List, "Y", "N" )

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
v-shex-msft
Community Support
Community Support

Hi @LiamNeufeld ,

Can you please share a pbix or some dummy data that keep the raw data structure with expected results? It should help us clarify your scenario and test to coding formula.

How to Get Your Question Answered Quickly  

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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