I have a dataset that includes a date column. I want to find the maximum date (newest date) so I can filter the dashboard to only show the latest information. My google skills are failing me and I haven’t been able to find how to calculate max date in C#. I’m guessing this is probably something common and very easy to do and I’ll feel silly when I figure it out, but hoping one of you lovely Dundas community members can help me figure it out
Here is a sample to obtain the most recent date from the records of a data cube and assign it to a filter control
The steps are briefly as the followings:
Create a column in your data cube that always shows the most recent date in your data set, (Detailed steps provided below)
Promote this date with the desired Time dimension (e.g. if you’d like to see only the year, you may promote it with the corresponding Time Dimension),
Use this new column in the Slicer of the Data Analysis panel of your metric set,
Create a New ViewParameter which is bound to your Calendar Range Filter and this Dimension.
(On a side note, this is possible to bind more than one viewParameter to a single filter control by right clicking on the Filter control -> Connect Filter -> Select Parameters button -> bind to the viewParameters that are required)
Now, here is the details for Step #1, on how to create a data cube that has the ‘MostRecentDate’:
Add your table to the data cube and uncheck all columns except the Date dimension that you need to see its most recent date.
Use Top/Bottom Transform and return only 1 row of the most recent date, the result would be like this:
Create a Calculated Element, that will be used later as the join Key, like below screenshot. It can return anything such as 1.
Add your initial data table once again to your data cube and create a Calculated element as explained above.
Then join the result with this new key.
In the Process result you’ll have the MostRecentDate copied for all rows and also, you have the initial Date column as well.