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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

I want a DAX Query to create a pivot calculated table

I have a table as below

Unique IDNameEquipment
A998877AlexLaptop
B554223BobMobile
K981265AlexLaptop
G674320JuliaDesktop
F437612SmithLaptop
Y764378AlexMobile

 

From this table i want to have a pivot table as below, please use Claculated DAX measure to create a pivot table, because i have created calculated columns , which cannot be used in power query.

NameLaptopMobileDesktop
Alex21 
Bob 1 
Julia  1
Smith1  



1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

Thanks for the reply from @miTutorials , please allow me to provide another insight: 

 

You can try the following DAX formula:

 

SummaryTable =

SUMMARIZE(

    'Table',

    'Table'[Name],

    "Laptop", CALCULATE(COUNTROWS('Table'), 'Table'[Equipment] = "Laptop"),

    "Mobile", CALCULATE(COUNTROWS('Table'), 'Table'[Equipment] = "Mobile"),

    "Desktop", CALCULATE(COUNTROWS('Table'), 'Table'[Equipment] = "Desktop")

)

 

vkaiyuemsft_0-1722480376664.png

 

 

If your Current Period does not refer to this, please clarify in a follow-up reply.

 

Best Regards,

Clara Gong

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

5 REPLIES 5
Anonymous
Not applicable

Thank you @Anonymous , it worked perfectly 

Anonymous
Not applicable

Hi @Anonymous ,

Thanks for the reply from @miTutorials , please allow me to provide another insight: 

 

You can try the following DAX formula:

 

SummaryTable =

SUMMARIZE(

    'Table',

    'Table'[Name],

    "Laptop", CALCULATE(COUNTROWS('Table'), 'Table'[Equipment] = "Laptop"),

    "Mobile", CALCULATE(COUNTROWS('Table'), 'Table'[Equipment] = "Mobile"),

    "Desktop", CALCULATE(COUNTROWS('Table'), 'Table'[Equipment] = "Desktop")

)

 

vkaiyuemsft_0-1722480376664.png

 

 

If your Current Period does not refer to this, please clarify in a follow-up reply.

 

Best Regards,

Clara Gong

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @Anonymous ,

 

Not the original poster, but I was trying to do something similar. This code mostly worked for what I needed, but I need to additionally filter my original table by a calculated column ("InCity").

 

Original table:

VisitIDDateSexInCity
A1/1/2024

Male

Y
B1/1/2024MaleY
C1/2/2024FemaleY
D1/3/2024MaleN
E1/3/2024FemaleY
F1/3/2024FemaleN
G1/4/2024

Male

Y
H1/4/2024FemaleY

 

And this is the table I want to create, where it includes counts of VisitID but only when InCity = Y:

 

DateMaleFemale
1/1/20242 
1/2/2024 1
1/3/2024 1
1/4/202411

 

I would really appreciate any guidance you can provide to update the code to include a filter for InCity=Y. Thank you!

miTutorials
Super User
Super User

Why do you need dax when this can be achieved using Matrix ?

 

miTutorials_0-1722438991398.png

 

Anonymous
Not applicable

Hello, I want Dax because i want to create a slicer for those item which is having the count of any equipment greater than 1

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors