Hi Everyone, I'm dealing for the first time with a dataset that appends [Export_Date_&_Time] every time an export is run from the datasource. Illustrating:
ID Export_Date_&_Time 250 more data elements/fields.... 01A 01/01/2015 24:00:00 02B 01/01/2015 24:00:00 01A 12/12/2015 24:00:00 02B 12/12/2015 24:00:00
I'm creating a bunch of measures using the [Export_Date_&_Time] values. For example:
MAXDate = MAX(REF_Opportunites[Export_Date_&_Time])
MINDate = MIN(REF_Opportunites[Export_Date_&_Time])
AbsoluteMAXDate = CALCULATE(MAX(REF_Opportunites[Export_Date_&_Time]), ALL(REF_Opportunites))
AbsoluteMINDate = CALCULATE(MIN(REF_Opportunites[Export_Date_&_Time]), ALL(REF_Opportunites))
Then a bunch of columns that will help me filter my visuals:
IsEarliestExportDate = IF(REF_Opportunites[Export_Date_&_Time]= [AbsoluteMINDate], "Earliest", "Later")
IsLatestExportDate = IF(REF_Opportunites[Export_Date_&_Time] = [AbsoluteMAXDate], "Latest", "Not Current")
IsEarliestandLatestExportDates = IF(REF_Opportunites[Export_Date_&_Time] = [AbsoluteMINDate] || REF_Opportunites[Export_Date_&_Time]= [AbsoluteMAXDate], "Yes", "No")
I have 2 questions...
Why is it that if I try to use [MaxDate] (vs [AbsoluteMaxDate]) in my "IsLatestExportDate" IF statement that I don't get the same result? With [Max Date] everything in my column changes to "Latest"? I would like to be able to use [Max Date] in the event that I want to install a slicer/filter on my dashboard that uses the [Export_Date_&_Time] Field. In this senario, if I choose any other option in the slicer other than the [AbsoluteMaxDate] it would render all the visualizations blank (assuming "IsLatestExportDate" is a visual/page level filter).
How would I go about creating a measure/column that would allow for the selection of the Maximum date AND the period directly prior to the max...? (I've tried to use LATEST here but it gave me an error about having duplicate date values in a column).....
If there is a better approach here I would love to hear it, I'm finding Date and Time functions in DAX extremely frustrating. Also, before you ask the [Export_Date_&_Time] field is not generated at any pre-defined interval so I don't believe any of the Time Intelligence functions will be of use.