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

The Fabric community is upgrading! Read all of the details including the timeline and what you can expect. Learn more

Reply
Anonymous
Not applicable

Matrix table multiple data types in same column

I'm trying to get a matrix table into the format below where my rows are my metrics and I have two column hierarchies: Time and Current/Prior. For each metric I want to have the raw values for "Current" and then a %increase/decrease in the "Prior" column.

cbb4_0-1622665292421.png

 

This data is coming via DirectQuery from SQL and it looks like this: 

cbb4_1-1622665292434.png

 

I'm doing the % calculation in the SQL query, but if it's easier to create a measure to do that work then I can pull in the raw values. 

Ideally what I need is the ability to have the Current values be formatted as currency and the prior values formatted as a percent. Unfortunately I can't use the FORMAT() function with direct query so that's off the table. Is there any other way to achieve this?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

What I wound up doing was reformatting the SQL code to look like this:

 

 

cbb4_1-1622734136941.png

 

That way Current/Prior are have two separate values and the "metric" is categorical. I got the idea from this post: Simple way to transpose columns and rows in SQL?

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

What I wound up doing was reformatting the SQL code to look like this:

 

 

cbb4_1-1622734136941.png

 

That way Current/Prior are have two separate values and the "metric" is categorical. I got the idea from this post: Simple way to transpose columns and rows in SQL?

DataInsights
Super User
Super User

@Anonymous,

 

You might try using a calculation group. Each calculation item within a calculation group has a format property.

 

https://www.sqlbi.com/articles/controlling-format-strings-in-calculation-groups/ 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.