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
NOVICE02
Helper III
Helper III

Need to show metrics by day (in columns) in Matrix

Hi All,

My transactional data looks like this. It's thousands of rows for each day with multiple variables. 

 

IDVariableVariable2Date
xxxxxxJan 1
xxxxxJan 2

right now I can only have it with the date running down vertically and the variable summaries running down vertically as well.

 

 

I need to summarize data like below.

 Jan1Jan2Jan3 
variable1sum/count/measure   
variable2Sum/count/measure   

 

Any idea/help would be appreciated

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

Not the exact.

In matrix display you have option show on rows - This will move the measure to rows.

 

Also, you can try to have a table like this and use it for further display.

union(
summarize(table,table[date],"Var","Variable 1", "Sum",sum(table[variable 1]), "Count",count(table[variable 1])),
summarize(table,table[date],"Var","Variable 2", "Sum",sum(table[variable 2]), "Count",count(table[variable 2]))
)

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin

View solution in original post

4 REPLIES 4
v-eachen-msft
Community Support
Community Support

Hi @NOVICE02 ,

 

You could unpivot variable columns ( or select other columns and then choose unpivot other columns ).

Then use matrix to show your data.

2-1.PNG

3-1.PNG

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

I tried unpivot but it's not supported in direct query and i have to keep this the same because there are too many columns to do an import without a lag

 

I wrote this to unpivot:

select
  cal_date,
  Calls_Handled
from
 OB_Portfolio4 unpivot (
    Volumes for Metrics IN (Calls_Handled AS 'Calls_Handled ')
  );

but keep getting this error:   Details: "Microsoft SQL: Incorrect syntax near the keyword 'AS'."

 

Any help would be appreciated

amitchandak
Super User
Super User

Not the exact.

In matrix display you have option show on rows - This will move the measure to rows.

 

Also, you can try to have a table like this and use it for further display.

union(
summarize(table,table[date],"Var","Variable 1", "Sum",sum(table[variable 1]), "Count",count(table[variable 1])),
summarize(table,table[date],"Var","Variable 2", "Sum",sum(table[variable 2]), "Count",count(table[variable 2]))
)

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin

I used your first recommendation. It was the easiest and fastest. Thanks so much and i will test the second as well soo

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.