cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
subhendude
Microsoft
Microsoft

Customize the default aggregation of subtotal in matrix visual

I've a fact table with few measures i.e.; [SuccessCount] and [FailureCount]. They are grouped by timestamp and customer. The requirement is to show a matrix report with a basic stepped layout feature with subtotals. Please note the SLA is calculated using a formula [SuccessCount]*100.0/([SuccessCount] + [FailureCount])

 

subhendude_0-1651583109472.png

The matrix report works perfectly with the subtotal except SLA field. It is simply adding the SLA numbers and show in the subtotal(red highlighted). I would like to apply a formula for SLA like [SuccessCount] Group by Customer & Timestamp *100.0/([SuccessCount] Group by Customer & Timestamp + [FailureCount] Group by Customer & Timestamp) and then show it in the subtotal.

 

Any pointers how can I achieve this?

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@subhendude , Assume these are measures

 

Divide([SuccessCount], ([SuccessCount] + [FailureCount]))  // create % measure 

 

if they are columns then

Divide(Sum(Table[SuccessCount]), (Sum([SuccessCount]) + Sum([FailureCount])  ))  // create % measure  - mark % from measure tool

View solution in original post

4 REPLIES 4
v-eqin-msft
Community Support
Community Support

Hi @subhendude ,

 

It seems that there is no measure in your sample file. I used @amitchandak 's method to create one, and I could not reproduce your issue:

Eyelyn9_0-1651820039082.png

Could you please share the logic of it and provide more details like screenshots to help us clarify your scenario?

 

Best Regards,
Eyelyn Qin

subhendude
Microsoft
Microsoft

@amitchandakThanks a lot! I tried the solution and it works indeed. However I've a date slicer to filter the date. When I add the measure to the matrix visual, it starts showing the data for every day and not the days according to the date slicer. 

 

In the above example, if I set the date 25th and 26th, it shows data for all the days with measure applied. Removing measures, the filter works as expected and shows data for 25th and 26th only.

amitchandak
Super User
Super User

@subhendude , Assume these are measures

 

Divide([SuccessCount], ([SuccessCount] + [FailureCount]))  // create % measure 

 

if they are columns then

Divide(Sum(Table[SuccessCount]), (Sum([SuccessCount]) + Sum([FailureCount])  ))  // create % measure  - mark % from measure tool

@amitchandak I added the calculated column using the formula but I'm looking for ways to calculate the subtotal of the SLA in the matrix report. It shows the sum of all the SLA's for that customer and timestamp.

 

subhendude_0-1651585473798.png

You can find the sample pbix here https://www.dropbox.com/s/lysjzjk2nkdf2o3/sample.pbix?dl=0

 

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors