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
GAURAV7781
Helper III
Helper III

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

Annotation 2019-07-26 221901.png

 

1 ACCEPTED SOLUTION

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.

Capture.PNG

Best Regards,

Cherry

 

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

10 REPLIES 10
parry2k
Super User
Super User

@GAURAV7781 so you trying that use select a date and use that date instead of today(), correct?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@parry2k  Yes Sir, I want this 

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

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @GAURAV7781 ,

Have you solved your problem?

If you have solved, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.

If you still need help, please feel free to ask.

Best  Regards,

Cherry

 

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.

Capture.PNG

Best Regards,

Cherry

 

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

thankyou so much sir


@v-piga-msft wrote:

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.

Capture.PNG

Best Regards,

Cherry

 


 

Hi @GAURAV7781 ,

I'm afraid that you should create with measure rather than calculated column.

If it is convenient, could you share your data sample and desired output so that we could help further on it?

Best  Regards,

Cherry

 

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-piga-msft Dear sir,

In power Query it is making alll dates wrongIn power Query it is making alll dates wrongI created relation ship of slicer with the dateI created relation ship of slicer with the dateIn slicer if nothing is selectedIn slicer if nothing is selectedIf i choose, It is not showing, I want if i choose date my calculation should change accordinglyIf i choose, It is not showing, I want if i choose date my calculation should change accordingly 

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.