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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
bensiqc
Helper I
Helper I

Create a matrix to display different sums / counts based on columns

Sorry for the not-very-descriptive title.

 

Basically, I have a table that looks like this:

 

IDCharge 1Charge 2Charge 3Charge 4
12.523.21null9.21
2null4.58null3.81
34.778.23null1.78

 

What I'd like to be able to do is build a matrix that looks like this:

 

Charge NameCountSumAvg
Charge 127.293.65
Charge 2316.025.34
Charge 3000
Charge 4314.804.93

 

Is there a way to do this? My limitations: using May 2023 Report Service application and need to maintain a direct query connection.

2 REPLIES 2
christinepayton
Super User
Super User

Yeah, you need to unpivot in Power Query first. Right click on the ID column in PQ and do "unpivot other columns". Then create your measures for the average, count, and sum and drop them into the "values" in a matrix (with the attribute column in rows). You can rename the values/attribute columns, too, just using it as a reference here. 

If I do that, I'm given a message saying that this will result in a table that cannot be used in DirectQuery mode. Is there any solution I can use that won't result in this?

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.