| title | Retain date formatting for Analysis Services in mobile reports | |
|---|---|---|
| description | In Mobile Report Publisher, add a measure to a shared dataset in Report Builder so that dates in Analysis Services data sources retain their data type. | |
| ms.date | 09/25/2024 | |
| ms.service | reporting-services | |
| ms.subservice | mobile-reports | |
| ms.topic | how-to | |
| ms.custom |
|
[!INCLUDE ssrs-mobile-report-deprecated]
Add a measure to a shared dataset in Report Builder so dates in [!INCLUDEssASnoversion_md] data sources retain their data type in [!INCLUDESS_MobileReptPub_Long].
The default return type for [!INCLUDEssASnoversion_md] queries is a string. When you build a dataset in [!INCLUDEssRSnoversion_md] Report Builder, the string type is respected and gets saved to the server.
However, when the JSON table renderer processes the dataset, it reads the value of the column as a string and renders strings. Then when [!INCLUDESS_MobileReptPub_Long] fetches the table, it also only sees strings.
The workaround for this constraint is to add a calculated member when you're creating a shared dataset in Report Builder. It works for both [!INCLUDEssASnoversion_md] multidimensional and tabular models.
-
Create a measure to hold the value of the date field in question, and in the expression field, choose the hierarchy/level of the date and append .CurrentMember.MemberValue. For example:
[Internet Sales].[Ship Date].CurrentMember.MemberValue:::image type="content" source="../../reporting-services/mobile-reports/media/ssas-calculated-member-report-builder.png" alt-text="Screenshot of the Calculated Member Builder box with the Expression text box called out.":::
-
Now you can append this calculated member to the set of columns by dragging it from the Calculated Members list in the bottom left and dropping it in the column grid on the right.
:::image type="content" source="../../reporting-services/mobile-reports/media/ssas-query-designer-calculated-member-report-builder.png" alt-text="Screenshot of the Query Designer with the Calculated Members section called out.":::