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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Tiphany01
Frequent Visitor

Matrix multiple measures display

Dear all,

I have the below data in excel and I would like to create a pivot in PowerBI as shown below. But I am unable to achieve the view I need. (Column Header interchange) The below is just an example :

 

Sample data:

AnimalsTypeLegsWeight
LionWild4200
TigerWild4220
DogDomestic415
CatDomestic45

 

Currently in PowerBI:

Tiphany01_0-1634557521682.png

 

Desired View:

Tiphany01_1-1634557559021.png

I have come across few posts suggesting unpivotting / calculation groups as a probable solution. But the dataset is of huge capacity and dont think both are feasable. Are there any other ways to achieve the desired view? 

1 ACCEPTED SOLUTION
v-xiaotang
Community Support
Community Support

Hi @Tiphany01 

Thanks for reaching out to us.

You can try this, create the table

vxiaotang_0-1634806581446.png

Table1 = GENERATE(
    VALUES('Table'[Animals]),
    {"Legs","Weight"})

then create a measure

Measure = 
    IF(MAX([Value])="Weight",
        CALCULATE(SUM('Table'[Weight]),FILTER('Table',[Type]=MAX([Type])&&[Animals]=MAX('Table1'[Animals]))),
        CALCULATE(SUM('Table'[Legs]),FILTER('Table',[Type]=MAX([Type])&&[Animals]=MAX('Table1'[Animals]))))

result

vxiaotang_1-1634806637340.png

 

 

Best Regards,

Community Support Team _Tang

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

View solution in original post

2 REPLIES 2
v-xiaotang
Community Support
Community Support

Hi @Tiphany01 

Thanks for reaching out to us.

You can try this, create the table

vxiaotang_0-1634806581446.png

Table1 = GENERATE(
    VALUES('Table'[Animals]),
    {"Legs","Weight"})

then create a measure

Measure = 
    IF(MAX([Value])="Weight",
        CALCULATE(SUM('Table'[Weight]),FILTER('Table',[Type]=MAX([Type])&&[Animals]=MAX('Table1'[Animals]))),
        CALCULATE(SUM('Table'[Legs]),FILTER('Table',[Type]=MAX([Type])&&[Animals]=MAX('Table1'[Animals]))))

result

vxiaotang_1-1634806637340.png

 

 

Best Regards,

Community Support Team _Tang

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

amitchandak
Super User
Super User

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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