Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi,
I have a set of dates from Date table (the usual Dim_Date) in a slicer. When I select a single date from the slicer, I want to create a calendar table with start date of 7 days before the selected date and an end date of 7 days after the selected date. Depending on my selection in the slicer the Date column will have varying dates for 15 days. If there is no selection i.e. the slicer has a selection of more than one value, the calendar table will not have any values. I want to use this column of dates as the X axis of a chart to plot variables in the Y axis. I am using the following DAX:
selDate = SELECTEDVALUE(Table[Date],UNICHAR(32))...
The new table is named as selTable -
selTable = CALENDAR(selDate-7, selDate + 7)
I selected the ShortDate format for selDate. When I display the values in a card, the value shows correctly and so are the dates with selDate+7 or selDate-7.
But the selTable is giving me an error "MdxScript(Model) Cannot convert " of type Text to Date". The measure selDate is already having a Date format. I am at a loss what to do. Please advise where I am going wrong.
Thanks in advance
Solved! Go to Solution.
You cannot create a table from a measure.
You can create a virtual table variable as part of your measure computation, but the final result of a measure needs to be a scalar (a single value).
Hello lbendlin, Thanks for the reply. I want to create a single column table only with dates. For example, with a code of
You cannot create a table from a measure.
You can create a virtual table variable as part of your measure computation, but the final result of a measure needs to be a scalar (a single value).
Creating calculated columns from measures is futile. Creating calculated tables from measures is impossible* as measures return a scalar value (* unless you were going for a single row/single column table)
User | Count |
---|---|
92 | |
85 | |
77 | |
66 | |
62 |
User | Count |
---|---|
110 | |
95 | |
95 | |
64 | |
59 |