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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
FEninja_
Helper I
Helper I

FILTER - Variable Date Not Working, But Fixed Date Value works.

PBIX FILE => https://www.dropbox.com/s/ajtw8674sjk1vxc/FE-AgileMetrics_MVP3-TEST.pbix?dl=0

EXACTLY WHAT I AM TRYING TO ACCOMPLISH: (Forecast Lines)

FEninja__0-1683042675885.png

 

========
Hello Productive People!

 

I need some help. I am trying to write some DAX code that will draw a flat forecasted line from "Today" to "FutureDate". However, something weird is happening. When I HARD-CODE a date - it works. But when I refer to a MEASURE that has a date-value, it doesn't work.

 

Can someone take a peek and see if anything jumps out?

 

Also, I am still learning DAX & PowerBI - so please feel free to critique my approach if there is a better method.

 

 

 

 

 

 

RETURN
//THIS CODE WORKS - WHAT I WANT
if( 
    ISBLANK(
        COUNTROWS(
            Filter(
                'DATE',
                'DATE'[Date] >= TODAY() && 'DATE'[Date] <= DATE(2023,08,27)
            )
        )
    ),BLANK(),lastval 
)

 

 

 

 

 

 

FEninja__0-1682950631888.png

 

 

 

 

 

 

// THIS CODE DOES NOT WORK

VAR projDate = [Release BD - Projected Completion Date (1)] 
RETURN
if( 
    ISBLANK(
        COUNTROWS(
            Filter(
                'DATE',
                'DATE'[Date] >= TODAY() && 'DATE'[Date] <=  projDate
            )
        )
    ),BLANK(),lastval 
)
Release BD - Projected Completion Date (1) = 
VAR daysUntilCompletion = [Release BD - Active Story Points]/[Release BD - Daily Story Point Velocity]
RETURN
if(
    [Release BD - Release End] > TODAY(),TODAY()+daysUntilCompletion,[Release BD - Release End]
)

 

 

 

 

 

 

FEninja__2-1682951137194.png

 



2 REPLIES 2
v-tangjie-msft
Community Support
Community Support

Hi @FEninja_ ,

 

Please try this measure:

Measure = 
VAR projDate = [Release BD - Projected Completion Date (1)] 
RETURN
if( 
    ISBLANK(
        COUNTROWS(
            Filter(
                ALL('DATE'),
                'DATE'[Date] >= TODAY() && 'DATE'[Date] <=  projDate
            )
        )
    ),BLANK(),lastval 
)

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

Thank you for your response! I updated my original post to include a sample PBIX file along with more clarity about what I hope to accomplish. Thanks for your help

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.