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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

Top Kudoed Authors