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

calculate subtotal percentage in a matrix without considering blank cells

i have a matrix that shows percentage per each column and row :

rows: current month

columns: difference between current month and previous month

values: measure[percentage of returned users]

 

i want to find the average row per each column but without considering any blank months .

current output 

lawada_0-1638354464848.png

for example , for column 63 output should be (20.93+16.67+20.59+12.50+23.33)/5=18.8%

 i want to show this output in the subtotal of matrix and create a measure for it to show it in a line chart

1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @lawada ,

 

Try this:

calculate(Averagex(Values(Table[Rows column]) , CALCULATE( [percentage of returned users]))

 

I create a simple sample, not the same, just for reference. Please check if it works for you.

Measure 1 = 
AVERAGEX ( VALUES ( 'Table'[Category] ), CALCULATE ( SUM ( 'Table'[Value] ) ) )

Icey_0-1640228848341.png

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Icey
Community Support
Community Support

Hi @lawada ,

 

Try this:

calculate(Averagex(Values(Table[Rows column]) , CALCULATE( [percentage of returned users]))

 

I create a simple sample, not the same, just for reference. Please check if it works for you.

Measure 1 = 
AVERAGEX ( VALUES ( 'Table'[Category] ), CALCULATE ( SUM ( 'Table'[Value] ) ) )

Icey_0-1640228848341.png

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@lawada , ideally you should do is using allselected or removefilters 

 

calculate(Averagex(Values(Table[Rows column]) , [percentage of returned users]), removefilter(Table[Rows column]))

thank you the measure worked out , is there a way i can get same result for subtotal field in the matrix? as when i enabled the subtotal for the rows, im getting the average for all cells including blank cells

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.

Top Solution Authors