Forum Discussion

bensiqc's avatar
bensiqc
Icon for Helper I rankHelper I
3 years ago

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

  • christinepayton's avatar
    christinepayton
    Icon for Most Valuable Professional rankMost Valuable Professional

    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. 

    • bensiqc's avatar
      bensiqc
      Icon for Helper I rankHelper I

      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?