Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Separated Texts in Matrix

Hi Community!   Hope all are safe an sound.   I have encountered an problem such that I cannot get a single count from the rows : Split Feature, Replace with delimiter methods  but still the matr...
  • v-luwang-msft's avatar
    5 years ago

    Hi Anonymous ,

    Try like following:

    1.use the following dax create column:

    kwth = SEARCH(",",'Table'[1_Key Names],,0)
    k11 = IF('Table'[kwth]>0,LEFT('Table'[1_Key Names],'Table'[kwth]-1),'Table'[1_Key Names])
    k12 = IF('Table'[kwth]>0,RIGHT('Table'[1_Key Names],LEN('Table'[1_Key Names])-'Table'[kwth]),BLANK())
    k2wth = SEARCH(",",'Table'[2_Key Names],,0)
    k21 = IF('Table'[k2wth]>0,LEFT('Table'[2_Key Names],'Table'[kwth]-1),'Table'[2_Key Names])
    k22 = IF('Table'[k2wth]>0,RIGHT('Table'[2_Key Names],LEN('Table'[2_Key Names])-'Table'[k2wth]),BLANK())

    Then get the below:

    2.calculate table base on the new colunm,then merge :

    Table 6 = (UNION('Table 3','Table 4','Table 5','Table 2'))

     

    test = TRIM('Table 6'[k12])
    

     

    Final use the follwoing measure:

    count = COUNT('Table 6'[test])

     

    Wish it is helpul for you!

    You could download my pbix file if you need!

     

     

     

    Best Regards

    Lucien