Forum Discussion

GAURAV7781's avatar
GAURAV7781
Icon for Helper III rankHelper III
7 years ago
Solved

How to change date in table?

In below image Calculation is my field in which some dax is used, This is planning report which I am developing BI,

As of now my dax is using Today() function, based on that calculation is working, But  Because of daily planning he want to change dates,

 

Can I chage current date in formation table by using slicer, Please help

Calcuation =

IF(('Table'[Days Lead Time to Vendor]+'Table'[Safety Stock No Of Days])>30,('Table'[Days Lead Time to Vendor]+'Table'[Safety Stock No Of Days])+TODAY(),30+TODAY())

What can i write to resolve? 

This is planning report so user wants to plan by entering different date

 

  • Hi GAURAV7781 ,

    By testing with your pbix, you could create the measure like below.

    In addition, please note that do not create the relationship between the two tables.

    Calcuation_ =
    IF (
        (
            MAX ( 'Table'[Days Lead Time to Vendor] )
                + MAX ( 'Table'[Safety Stock No Of Days] )
        ) > 30,
        MAX ( 'Table'[Days Lead Time to Vendor] )
            + MAX ( 'Table'[Safety Stock No Of Days] )
            + SELECTEDVALUE ( 'Calender'[Date] ),
        30 + ( SELECTEDVALUE ( Calender[Date] ) )
    )
    

    Here is the output.

    Best Regards,

    Cherry

     

10 Replies

      • v-piga-msft's avatar
        v-piga-msft
        Icon for Resident Rockstar rankResident Rockstar

        Hi GAURAV7781 ,

        Please replace Today() function with SELECTEDVALUE('Table'[Date column]).

        And the 'Table'[Date column] should be the column which you created as date slicer.

        Best  Regards,

        Cherry