Forum Discussion
Angads
3 years agoAdvocate I
Help with dax!
I want if select all is selected in date slicer it should show total sales for all dates, if no date selected it should show last date sales in date column and id any specific date selected it should show sales for that date.
There is no string "select all" in date column. And we can't compare date with string.
these are limitations please give proper result..
Values on selection = IF(ISFILTERED(Sheet1[Date]),CALCULATE([Sum of Values]),IF(NOT ISFILTERED(Sheet1[Date]),CALCULATE([Sum of Values],LASTDATE(Sheet1[Date]))))
with the above formula I am able to achieve if no date selected it should show last date sales in date column and id any specific date selected it should show sales for that date.
with the above formula I am able to achieve if no date selected it should show last date sales in date column and id any specific date selected it should show sales for that date.
Any help will be great.
13 Replies
- devanshiHelper V
Totalsales = SUM([Sales])
VAR lastdatesvalues = CALCULATE(SUM([Sales]),LASTDATE(Date table))
VAR selected date = IF(ISFITHERED(Date table),
IF(Date table)=BLANK(),lastdates),SUM([Sale]))
RETURN
Totalsales