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
NeilC
Frequent Visitor

DateADD to add x days to slicer value

Hi

 

I have a slicer to give me a single date from my data table (Table1).

 

I want a measure to take the selected date and add +1 days to this, so it returns a value (Calls) for the the day after the one selected.

 

Tried this, but it just returns a BLANK.

 

Measure= calculate(SUM('Table1'[Calls]),FILTER('Table1','Table1'[Date]=DATEADD(Table1[Date],1,DAY)))

 

Do I need to do something different?

10 REPLIES 10
OPS
Frequent Visitor

have you got the solution. i have the ame issue

Vvelarde
Community Champion
Community Champion

@NeilC

 

Hi, create this measure and use it in your dax formula

 

Date+1.png




Lima - Peru

Sorry not having any luck with this. I tried your formula, but I just get a BLANK when I put the measure in the card

 

 

.PBI.png

Vvelarde
Community Champion
Community Champion

@NeilC

 

Please, do some test:

 

are you select only one date in your slicer?

 

The slicer is the Date field from Table1?

 

If all this is correct do this:

 

What happens if you change the measure to this:

 

DateSelected+1Day = If(HASONEVALUE(Table1[Date]);VALUES(Table1[Date])+1,DATE(1999;1;1))




Lima - Peru

All is as you have suggesested, and tried the new formula in measure.

 

still showing as BLANK.

 

Tried it with a new set of data, but still get BLANK.

 

this is my new date +1 measure. It returns a new date value ok :

 

DateSelected+1Day = If(HASONEVALUE(Table1[Date]),VALUES(Table1[Date])+1,DATE(1999,1,1))

 

this is my new volume measure, but just shows blank:

 

Measure = calculate(SUM('Table1'[Calls Ans]),FILTER(Table1,Table1[Date]=[DateSelected+1Day]))

Hi @NeilC,

You Table1[date] is continuous. If it is, for the solution above. You need to create a new table by clicking "New Table" under Modeling on home page.

NewTable=SELECTCOLUMNS(Table1,"Date",Table1[Date])


And there is no relationship between new table and Table1.

Then, create a slicer using NewTable[Date] as slicer. Create a measure to get value in NewTable.

DateSelected+1Day = If(HASONEVALUE(NewTable[Date]);VALUES(NewTable[Date])+1,DATE(1999;1;1))

Then create a measure, you will get expected result.

Measure = calculate(SUM('Table1'[Calls Ans]),FILTER(Table1,Table1[Date]=[DateSelected+1Day]))


More details, please refer to this similar thread.

Best Regards,
Angelia

Hi Angelia

 

Thank you for taking the time to go through this. i have followed it through as detailed by you, and do understand it.

 

It is recognising the new correct date (date +1), but is not returning a figure for the Calls on that day. Still showing BLANK.

 

I have tried this with a seperate set of data, but still get this BLANK.

 

I did get a workaround to work. By seting the slider to a date range, I put one measure as the MIN result, and one as the MAX result. This gave me two measures that I could compare. So I know the data is not formatted incorrectly. This works ok for getting two results, but I really need to get a few on the dasboard at a time. All solutions with a Slicer as a list just havent worked for me. Getting the date works ok, but it never returns a value for the number of calls.

Hi @NeilC,

Glad to hear that your issue got resolved. Please mark corresponding reply as answer, which will help other people find the solution easily.

Best Regards,
Angelia

Hi Victor

 

Thanks for replying.

 

I want the Card to show the number of calls for the Date +1, rather than the date itself.  How would that show in my original formula:

 

  Measure= calculate(SUM('Table1'[Calls]),FILTER('Table1','Table1'[Date]=DATEADD(Table1[Date],1,DAY)))

 

Thanks

Vvelarde
Community Champion
Community Champion

@NeilC

 

What happens if you replace this part of your measure:

 

 

DATEADD(Table1[Date],1,DAY)

 

With the MEasure DateSelected+1Day




Lima - Peru

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.