Forum Discussion
DAX distinct count measure on Pipe separated string
- 3 years ago
=
VAR _p =
CONCATENATEX ( VALUES ( FactSalesTag[Tag] ), 'FactSalesTag'[Tag], "|" )
VAR _t =
ADDCOLUMNS (
GENERATESERIES ( 1, PATHLENGTH ( _p ) ),
"@tag", TRIM ( PATHITEM ( _p, [Value] ) )
)
RETURN
COUNTROWS ( SUMMARIZE ( _t, [@tag] ) )
=
VAR _p =
CONCATENATEX ( VALUES ( FactSalesTag[Tag] ), 'FactSalesTag'[Tag], "|" )
VAR _t =
ADDCOLUMNS (
GENERATESERIES ( 1, PATHLENGTH ( _p ) ),
"@tag", TRIM ( PATHITEM ( _p, [Value] ) )
)
RETURN
COUNTROWS ( SUMMARIZE ( _t, [@tag] ) )
Hi wdx223_Daniel - I'm using Visual Studio Editor and FactSalesTag is empty. I have processed model after deploying to server. Can you please help
- wdx223_Daniel3 years ago
Community Champion
......
RETURN
IF(_SplitData="",0,COUNTROWS(....))
- abhiram3423 years ago
Microsoft Employee
Thanks wdx223_Daniel for your response. I'm still getting same error. I can see the data Temp but when I drag related columns . example Date Dimension then it gives error as below. Is there any better way to debug this issue. Please let me know
BackEnd Query:
EVALUATE
SUMMARIZECOLUMNS(
'Date'[Fiscal Month],
'Date'[Month Key],
"UniqueTagMeasureCount", [UniqueTagMeasureCount]
)
ORDER BY
'Date'[Fiscal Month] ASC,
'Date'[Month Key] ASCError:
The arguments in GenerateSeries function cannot be blank.
- wdx223_Daniel3 years ago
Community Champion
IF(_SplitData=""||_SplitData="|",0,COUNTROWS(....))