Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

DAX to create Pivot Table

I would like to create a new Pivot Table, What DAX can make it

 

Orig Table

DeviceSoftware
as1
as2
bs1

 

Pivot Table

Device s1s2
aTRUETRUE
bTRUEFALSE
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Anonymous 

    You can create a calculated table to return the table you want .

    New Table =
    var _summar=SUMMARIZE('Table','Table'[Device], "combine", CONCATENATEX('Table',[Software],","))
    var _t=ADDCOLUMNS(_summar,"s1",IF(CONTAINSSTRING([combine],"s1"),TRUE(),FALSE()), "s2",IF(CONTAINSSTRING([combine],"s2"),TRUE(),FALSE()))
    return SUMMARIZE(_t,[Device],[s1],[s2])

    The final result is as shown :

    I have attached my pbix file , you can refer to it .

     

    Best Regards,
    Community Support Team _ Ailsa Tao
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous 

    You can create a calculated table to return the table you want .

    New Table =
    var _summar=SUMMARIZE('Table','Table'[Device], "combine", CONCATENATEX('Table',[Software],","))
    var _t=ADDCOLUMNS(_summar,"s1",IF(CONTAINSSTRING([combine],"s1"),TRUE(),FALSE()), "s2",IF(CONTAINSSTRING([combine],"s2"),TRUE(),FALSE()))
    return SUMMARIZE(_t,[Device],[s1],[s2])

    The final result is as shown :

    I have attached my pbix file , you can refer to it .

     

    Best Regards,
    Community Support Team _ Ailsa Tao
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Yes, works perfect. Thand you very much

  • tamerj1's avatar
    tamerj1
    Icon for Community Champion rankCommunity Champion

    Hi Anonymous 

    Meaure = NOT ISBLABK ( Table[Software] ]