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
LP2803
Responsive Resident
Responsive Resident

Doble row Column Header

Hi Team,

 

I have a car sales data in my powerbi like the below picture 1 and all i would like is to recreate a percentile table like the picture 2 below.  Kindly help me how can i achieve this result.

 

Picture 1:

LP2803_0-1597001268221.png

 

Picture 2:

LP2803_2-1597001441371.png

 

 

I have the percentiles calculated in a measure. But unable to get the name of the percentile in the column value (like the highted in picture 2)

 

Please help me.

1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @LP2803 ,

 

If you want to achieve the effect of your Picture 2, you should create another table, as shown below. This table was created with Enter Data. The sort column is intended to sort the Infor columns in the specified order.

enter data.png

sort.png

 

After you've created the new table, you can write your measures like this.

measure =
IF (
    MAX ( 'Table (2)'[Infor] ) = "Sales Amount",
    SWITCH (
        MAX ( 'Table (2)'[percentile] ),
        "25th percentile", ( PERCENTILE.INC ( 'Table'[Sales Amount], 0.25 ) ),
        "50th percentile", ( PERCENTILE.INC ( 'Table'[Sales Amount], 0.5 ) ),
        "75th percentile", ( PERCENTILE.INC ( 'Table'[Sales Amount], 0.7 ) )
    ),
    SWITCH (
        MAX ( 'Table (2)'[percentile] ),
        "25th percentile", ( PERCENTILE.INC ( 'Table'[Order quantity], 0.25 ) ),
        "50th percentile", ( PERCENTILE.INC ( 'Table'[Order quantity], 0.5 ) ),
        "75th percentile", ( PERCENTILE.INC ( 'Table'[Order quantity], 0.7 ) )
    )
)

 

Then you can create a matrix view, as shown below. Be careful not to reverse the order of the columns.

matrix.png

 

Click the button in the red box and the display is as below.

matrix2.png

If you don't want to see the Total value, just turn it off in Subtotals under Format. The result is as below.

total.png

matrix3.png

You can check more details from here.

 

 

Best Regards,

Icey

 

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
Icey
Community Support
Community Support

Hi @LP2803 ,

 

If you want to achieve the effect of your Picture 2, you should create another table, as shown below. This table was created with Enter Data. The sort column is intended to sort the Infor columns in the specified order.

enter data.png

sort.png

 

After you've created the new table, you can write your measures like this.

measure =
IF (
    MAX ( 'Table (2)'[Infor] ) = "Sales Amount",
    SWITCH (
        MAX ( 'Table (2)'[percentile] ),
        "25th percentile", ( PERCENTILE.INC ( 'Table'[Sales Amount], 0.25 ) ),
        "50th percentile", ( PERCENTILE.INC ( 'Table'[Sales Amount], 0.5 ) ),
        "75th percentile", ( PERCENTILE.INC ( 'Table'[Sales Amount], 0.7 ) )
    ),
    SWITCH (
        MAX ( 'Table (2)'[percentile] ),
        "25th percentile", ( PERCENTILE.INC ( 'Table'[Order quantity], 0.25 ) ),
        "50th percentile", ( PERCENTILE.INC ( 'Table'[Order quantity], 0.5 ) ),
        "75th percentile", ( PERCENTILE.INC ( 'Table'[Order quantity], 0.7 ) )
    )
)

 

Then you can create a matrix view, as shown below. Be careful not to reverse the order of the columns.

matrix.png

 

Click the button in the red box and the display is as below.

matrix2.png

If you don't want to see the Total value, just turn it off in Subtotals under Format. The result is as below.

total.png

matrix3.png

You can check more details from here.

 

 

Best Regards,

Icey

 

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

Anand24
Super User
Super User

Hi @LP2803 ,

Measures can't be pulled in the column field of matrix visualization but columns can.

 

Here is what you can do:

1. Create a new column with same formulae/calculations as that of your measure and pull it in columns field of matrix viz

2. Create a new column, simply assign it with your Measure and pull it in columns field of matrix viz:

New Percentile_Column = [Percentile_Meausure]

 

Give a thumbs up if this post helped you in any way and mark this post as solution if it solved your query !!! 

LP2803
Responsive Resident
Responsive Resident

Hi Anand, Thank for the help.

 

I get incorrect result when i make my measure into a column

 

my measure is like "Percentilex.inc(table1,table1[salesamount])

 

Could you please help me how can i rewrite this in the column to get the same results.

LP2803
Responsive Resident
Responsive Resident

Please can any one help me with this. there is an urgent requirement for this.

Please help.

Greg_Deckler
Super User
Super User

@LP2803 - I believe you can have a hierarchy in your columns of your matrix. If all else fails, there is always this:

https://community.powerbi.com/t5/Quick-Measures-Gallery/The-New-Hotness-Custom-Matrix-Hierarchy/m-p/...

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.