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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
dancarr22
Helper V
Helper V

How to create a pivot table where the same field is in rows and columns but with different filters?

Hello,

 

We have a PBI data model with 2 tables:

(1) A table of processes - each has a unique ID called Process ID.  i.e. Process ID 1 = Load food price data from Vendor X.  So, 2 pieces of data associated with this "Price Data" and "Vendor X"

(2) A table of tags associated with the processes in (1).  So, we have 2 records associated with ID 1.  Tag 1 (Dataset) = "Price Data" and Tag 2 (Vendor) = "Vendor X"

Process IDTag IDTag TypeTag Value
11DatasetPrice Data
12VendorX

 

We want to create a pivot table in PBI where we have columns be Vendor and rows be Dataset - so we can see the combination of what every vendor sends us.  But, we cannot filter the fields separately since they're in the same table.  Thoughts on how to accomplish this?

Thanks!

Dan

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@dancarr22 , Based on what I got so fare you have create measures

 

Of handle condition in a measure

 

M1= Switch(True(),

Max(Table[tags]) = "A"  && Max(Table[Vendor] ) = "Vendor X", [Value],

[Value2]

)

 

 

You can correct the sum as

 

Sumx(Summarize(Table, Table[Process ID]), [M1])

 

 

 

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@dancarr22 , Based on what I got so fare you have create measures

 

Of handle condition in a measure

 

M1= Switch(True(),

Max(Table[tags]) = "A"  && Max(Table[Vendor] ) = "Vendor X", [Value],

[Value2]

)

 

 

You can correct the sum as

 

Sumx(Summarize(Table, Table[Process ID]), [M1])

 

 

 

Thanks Amit!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.