SQL Server 2017: New DAX Functions – GENERATESERIES/SELECTEDVALUE
SQL Server Analysis Service 2017 includes support for new DAX functions. In order to take advantage, you need to use the latest version of SSDT.
GENERATESERIES and SELECTEDVALUE are the functions covered here.
Even the What If feature of PowerBI generates table based on the above two functions.
GENERATESERIES:
This function is useful to create a series of number between two digits. It is one of the few functions in DAX that generates new data.
What If parameter in PowerBI uses the GENERATESERIES() function to generate a table that can be useful as slicer values.
Previously, one need to create table manually using the ‘New Table’ option in PowerBI
Syntax: GENERATESERIES(<startValue>, <endValue>[, <incrementValue>])
GENERATESERIES()
Also, one can join/append as many tables as one likes using UNION to create non-sequential number range.
UNION in DAX is similar to UNION ALL in SQL.
SELECTEDVALUE:
This function returns the selected value in table. If multiple values are selected, it would return ‘Blank’.
If no value is selected, it would return ‘Alternate Result’ stated by the user.
Also, one can join/append as many tables as one likes using UNION to create non-sequential number range.
UNION in DAX is similar to UNION ALL in SQL.
SELECTEDVALUE:
This function returns the selected value in table. If multiple values are selected, it would return ‘Blank’.
If no value is selected, it would return ‘Alternate Result’ stated by the user.
No comments: