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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
edg
New Member

Different data types for rows in Matrix Table (after unpivoting)

 

Hello! So I have jsut started to figure out PowerBI Desktop and faced some problems. Unofortunately I couldn't find how do this so I hope someone here can help me. 

I created Matrix table with the following rows (on screenshot):

Impressions,Clicks,Visits,Conversions,Page Depth,Bounce Rate,Time on Site

 

However I was only able to format a whole column "Value" as a decimal number. What I want to do is for example format Bounce Rate row as a percentage and Page Depth as a decimal number with 2 digits after "."

 

How can I achieve that?

 

Is there a way to custom sort these "Stats" in an order I want to?

 

 

 

 

screen1bi.JPGscreen2bi.JPG

 

5 REPLIES 5
j7r8
Regular Visitor

I am having a very similar issue, and working with a similar sort of data set. I am working with Fallout / Completion Counts and Rates for various web services, and trying to display it as a time-series bar / line chart with a data table underneath that shows, How many people started and completed the action (Sum), and the completion rate percentage (Average) each Month. My original table had a table with the following attributes: Transaction, Date, Start, Complete, Rate. I order to accomplish this I unpivoted that table so I have Transaction, Date, Attribute, and Value.The rows where Attribute = Rate are Percents. The rest are whole numbers. The chart looks great except for not displaying rate as a percent and summing rate instead of averaging it. I am a n00b, totally open to suggestions. Thank you! Examples of what I'm using and trying to do below:

 

Original Data TableOriginal Data TableUnpivoted the data columnsUnpivoted the data columnsTable that goes along with time series bar chartTable that goes along with time series bar chart

j7r8
Regular Visitor

Okay, I think I figured it out. At least for me, this is what worked (Credit goes to Sabrina Zenatti's Matrix Formatting Article😞

After I un-pivoted my original table, I created a formatted column in the unpivoted data table:

 
FormattedValue =
IF ( FlowsDataTable_Flat[Attribute] = "Rate", FORMAT(FlowsDataTable_Flat[Value],"#%"), FORMAT(FlowsDataTable_Flat[Value],"###,###"))
 
After that I just updated the Matrix table to reference this new column instead of the previous column and I'm in business! I hope this helps 😁
Eric_Zhang
Microsoft Employee
Microsoft Employee

@edg

 

Regarding sorting, the only way I can think of is to change the stat with sorting number prefix or another column that can be sorted in that order.
Capture555.PNG

 

As to the different types in the matrixs, IMHO, it doesn't makes sense to a matrixs. If you're still insist it, you can pivot the data and display it in a table instead.

Capture.PNGCapture2.PNGCapture3.PNG

 

Check more details in the attached pbix.

sdjensen
Solution Sage
Solution Sage

If you want to format the values differently you will have to create seperate measures. This way you can also control the order as they will show in the order you add them to the visual. However I don't think you will be able to have you measures as rows they will apear as columns.

/sdjensen

Is there any other idea? Maybe before the step of unpivoting columns with metrics (when I actually had columns in data table: bounce rate, impressions, clicks, etc)

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.