GOAL: I'm trying to create a table in Power BI with different measure.
Every measure has a different filter, for example:
Realised Savings Azure App Service v2 =
CALCULATE(SUM('Usage details'[costInBillingCurrency]), FILTER ( 'Usage details', 'Usage details'[meterCategory] = "Azure App Service" && CONTAINSSTRING('Usage details'[meterName.1], "v2") ))
Realised Savings Azure App Service v3 =
CALCULATE(SUM('Usage details'[costInBillingCurrency]), FILTER ( 'Usage details', 'Usage details'[meterCategory] = "Azure App Service" && CONTAINSSTRING('Usage details'[meterName.1], "v3") ))
Realised Savings DTU =
CALCULATE(SUM('Usage details'[costInBillingCurrency]), FILTER ( 'Usage details', 'Usage details'[meterCategory] = "SQL Database" && CONTAINSSTRING('Usage details'[meterName.1], "DTU") ))
Realised Savings vCore =
CALCULATE(SUM('Usage details'[costInBillingCurrency]), FILTER ( 'Usage details', 'Usage details'[meterCategory] = "SQL Database" && 'Usage details'[meterName.1] = "vCore" ) )
Realised Savings VMs =
CALCULATE ( SUM ( 'Usage details'[costInBillingCurrency] ), FILTER ( 'Usage details', 'Usage details'[meterCategory] = "Virtual Machines" ) )
PROBLEM: I have checked the totals and they are alright. I'm happy, I reached my goal!
But when I try to put them into a table, horror: they create columns instead of rows:
I don't want to have them like that.
What I want is this:
MeterCategory | Total |
---|---|
Realised Savings Azure App Service v2 | 4147.091 |
Realised Savings Azure App Service v3 | 4889.731 |
Realised Savings DTU | 12915.273 |
Realised Savings vCore | 238.528 |
Realised Savings VMs | 5859.370 |
So how to pivot this table?
I tried the Matrix but it seems like it's not working.
Should I create a table instead of 5 different measures?