Forum Discussion
Modified Date Slicer
- 5 years ago
Hi BishwaR ,
First create a column as below:
_rank = RANKX('Data','Data'[Sales Date],,ASC,Dense)Then create a measure as below:
Measure = var _rank=CALCULATE(MAX('Data'[_rank]),FILTER(ALL(Data),'Data'[Sales Date]=SELECTEDVALUE('Date Table'[Date]))) var _tab1=CALCULATETABLE(VALUES('Data'[Sales Date]),FILTER(ALL(Data),'Data'[_rank]=_rank-1)) var _tab2=CALCULATETABLE(VALUES(Data[Sales Date]),FILTER(ALL(Data),'Data'[_rank]>=_rank-3&&'Data'[_rank]<_rank)) Return IF(SELECTEDVALUE('Date Table'[Day])="Mon", IF(MAX('Data'[Sales Date]) in _tab2,1,BLANK()), IF(MAX('Data'[Sales Date]) in _tab1,1,BLANK()))And you will see:
For the related .pbix file,pls see attached.
Best Regards,
KellyDid I answer your question? Mark my post as a solution!
Hi,
I am not using the rank filter which you have created but I have created a measure that works pretty well with the scenario.
Thank you so much for your help. Yes it worked fine. But I have at least 4 more attributes like sales with discount, sales before discount etc as a result I have to create the separate measure for each column. So I was looking for a solution by manipulating the date_table rather than the Fact_Table.
- sayaliredij5 years agoSolution Sage
In this case, you can create a calculation group with the same settings.
Just saying. in case you want to have only one filter and not have multiple measures
Thanks,
sayali
- BishwaR5 years agoHelper V
If I create all the measures using this set of calculations will I be able to use other slicers like Product Category, Location etc ?
- sayaliredij5 years agoSolution Sage
Yes I think so
Thanks,
sayali