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
Tom12
New Member

Adjust date in date column via a parameter

Hi

 

I am trying to plot transactions values by dates where I have adjusted the value and date via parameters.

 

I have created a measure for the adjusted value:

AdjustedAmount = SUM('Transactions'[Amount]) * (1+[Value Adjustment 2 Value]/100)

 

however I am struggling to adjust the date in the same way:

AdjustedDate = DATEADD(Transactions[Date], 'Value Adjustment 2'[Value Adjustment 2 Value],DAY)
 
I want the date adjustment to be dynamic so am keen to use a paramenter, but I cant work out how.
Any help appreciated
 
Thanks
 
Tom
1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @Tom12 

As tested, if i use the formula "AdjustedDate" in the measure, then add this measure in the visual, it would throw an error.

This is because "DATEADD" function returns a table instead of a list of values.

If you want to adjust date dynamically for a calcuation, for example:

Measure 1 = CALCULATE(COUNT('Table'[Date]),DATEADD('Table'[Date],[Parameter Value],DAY))

It is possible.

 

But if you want to adjust dates list directly, you could create a simple measure. 

In Power BI, It will increase dates intelligently.

Measure 2 = MAX('Table'[Date])+[Parameter Value]

10.png

Best Regards

Maggie

 

Community Support Team _ Maggie Li
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

3 REPLIES 3
v-juanli-msft
Community Support
Community Support

Hi @Tom12 

As tested, if i use the formula "AdjustedDate" in the measure, then add this measure in the visual, it would throw an error.

This is because "DATEADD" function returns a table instead of a list of values.

If you want to adjust date dynamically for a calcuation, for example:

Measure 1 = CALCULATE(COUNT('Table'[Date]),DATEADD('Table'[Date],[Parameter Value],DAY))

It is possible.

 

But if you want to adjust dates list directly, you could create a simple measure. 

In Power BI, It will increase dates intelligently.

Measure 2 = MAX('Table'[Date])+[Parameter Value]

10.png

Best Regards

Maggie

 

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

Anonymous
Not applicable

Capture1.PNG

 

Hi @v-juanli-msft 

 

How to Generate New column by using Date & measure2

Ex:-  Date                  Measure2         Day'sDiff

        01-01-2018       04-01-2018      3 

 

Thank you

naveen

 

Thanks Maggie, that works really well
Tom

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.