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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
FEninja_
Frequent Visitor

TODAY()-1 VS MAX(date) - Weird Behavior

Hello!

I am encountering a weird problem, let me explain it:

Today is 03/13/2023 - and I need to reference Yesterday in my equation.

I have a dax function that when this value is hard-coded (2023,03,12) - the graph shows the appropriate line "f.scope".

FEninja__0-1678718828322.png

 

However, when the hard-coded line is replaced with a measure (that has the same value) - the line disappears! (see screenshot, "Release-Last Visible Date" has same date value).

FEninja__1-1678718860387.png

Can anybody shed some light into what may be happening?? (DAX BELOW)

BD User Story Scope Forecast = 
VAR rStart = [BD Release Start]
VAR rEnd = [BD Release End]
VAR lastDt= [Release - Last Visible Date]
VAR lastval = CALCULATE(
    [BD User Story Scope]
    ,'DATE'[Date]= lastDt //DATE(2023,03,12)// TODAY()-1
)

RETURN
if( 
    ISBLANK(
        COUNTROWS(
            Filter(
                'DATE',
                'DATE'[Date] >= TODAY() && 'DATE'[Date] <= [BD Release End]
            )
        )
    ),BLANK(),lastval  
1 ACCEPTED SOLUTION

Thank you for your feedback! I did check this, & that was the case - however my issue didn't go away. But I ended up resolving it by taking a closer look at "Release - Last Visible Date" - I realized that the date column was being filtered which was limiting my results. However, after adding a FILTER to this measure + ALL() - My issue was resolved.

Thanks for helping me get there!

FEninja__0-1678800610541.png

 

View solution in original post

2 REPLIES 2
johnt75
Super User
Super User

Is it possible that [Release - Last Visible Date] is returning a datetime rather than just a date ? One way to check might be to use Performance Analyzer to copy the code for the visual, paste it into DAX Studio and then amend the measure to return the lastDt variable, or simply add a new column to the SUMMARIZECOLUMNS which shows the [Release - Last Visible Date] measure.

Thank you for your feedback! I did check this, & that was the case - however my issue didn't go away. But I ended up resolving it by taking a closer look at "Release - Last Visible Date" - I realized that the date column was being filtered which was limiting my results. However, after adding a FILTER to this measure + ALL() - My issue was resolved.

Thanks for helping me get there!

FEninja__0-1678800610541.png

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.