Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Jimmy_hu
Frequent Visitor

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
1 ACCEPTED SOLUTION
v-yetao1-msft
Community Support
Community Support

Hi @Jimmy_hu 

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 :

Ailsamsft_0-1651041764493.png

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.

View solution in original post

3 REPLIES 3
v-yetao1-msft
Community Support
Community Support

Hi @Jimmy_hu 

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 :

Ailsamsft_0-1651041764493.png

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.

Yes, works perfect. Thand you very much

tamerj1
Super User
Super User

Hi @Jimmy_hu 

Meaure = NOT ISBLABK ( Table[Software] ]

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.