Forum Discussion
Need to change this DAX table
- Anonymous5 years ago
Hi skashifz
I think you want to build a line chart to show SalesAmounts in previous 14 dates. Try to build an unrelated calendar table and build a measure to filter your visual.
Calendar = SUMMARIZE(ALL(DimDate),DimDate[DateKey],DimDate[FullDateAlternateKey])Measure:
Measure = VAR _SelectDate = SELECTEDVALUE('Calendar'[FullDateAlternateKey]) RETURN IF(MAX(DimDate[FullDateAlternateKey])>=_SelectDate-14&&MAX(DimDate[FullDateAlternateKey])<_SelectDate,1,0)Add this visual into filter field in line visual and set it to show items when value = 1. Result is as below. When I select 20140128, we will get result from 20140114 to 20140127.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak , thank you very much for the response. I am not trying to change value of calculated column. I am trying to create a new "measure table", The table created in my example is based on the maximum date, Is this possible to create similar measure table based on date seelected from slicer instead of the max date picked from the base table ?
If there is a way to get the list of previous 14 dates, then I am sure, there can be a way to also include the corresponding SalesAmounts for each row.
My problem is, I dont want one SUM of all at the end, i need individual values, So I can try to draw a line chart for the 14 day window finishing at slicer date.
Hope I make sense.
Hi skashifz
I think you want to build a line chart to show SalesAmounts in previous 14 dates. Try to build an unrelated calendar table and build a measure to filter your visual.
Calendar =
SUMMARIZE(ALL(DimDate),DimDate[DateKey],DimDate[FullDateAlternateKey])
Measure:
Measure =
VAR _SelectDate = SELECTEDVALUE('Calendar'[FullDateAlternateKey])
RETURN
IF(MAX(DimDate[FullDateAlternateKey])>=_SelectDate-14&&MAX(DimDate[FullDateAlternateKey])<_SelectDate,1,0)
Add this visual into filter field in line visual and set it to show items when value = 1. Result is as below. When I select 20140128, we will get result from 20140114 to 20140127.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.