cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Post Partisan

## Getting Total Percentage in Card of Column with Percentages in Matrix Table

Hi all,

I have a table viz in my report with a card above it.

I need the card 'Occupancy Total' to provide a percentage of the listed percentages - a kind of grand total percentage if you like.

The only condition is that it should not include any blank items.

To get the Occupancy column, I use this DAX:

``````Occupancy =
DIVIDE([Total Leased Area (Current)], [Total Leasable Area (Current)], 0)``````

Is it possible to create a new measure, count the non blank rows in the Occupancy column, and calculate the percentage of the percentages?

1 ACCEPTED SOLUTION
Community Support

Hi @julesdude

You can use the sumx() function first, then use divide() function

You can refer to the following example

Sample data

RelatedMeasure

``````TotalValue = SUM('Table'[value])

Totalcount = COUNTROWS('Table')

Occupancy = DIVIDE([TotalValue],[Totalcount],0)``````

Displayed visual

Then create a measure to calculate percentage of occupancy

``````Occupany total = var _sum=SUMX(ALLSELECTED('Table'[Column1]),[Occupancy])
var _count=COUNTROWS(FILTER(ALLSELECTED('Table'[Column1]),[Occupancy]<>BLANK()))
return DIVIDE(_sum,_count)``````

Output

Best Regards!

Yolo Zhu

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

Community Support

Hi @julesdude

You can use the sumx() function first, then use divide() function

You can refer to the following example

Sample data

RelatedMeasure

``````TotalValue = SUM('Table'[value])

Totalcount = COUNTROWS('Table')

Occupancy = DIVIDE([TotalValue],[Totalcount],0)``````

Displayed visual

Then create a measure to calculate percentage of occupancy

``````Occupany total = var _sum=SUMX(ALLSELECTED('Table'[Column1]),[Occupancy])
var _count=COUNTROWS(FILTER(ALLSELECTED('Table'[Column1]),[Occupancy]<>BLANK()))
return DIVIDE(_sum,_count)``````

Output

Best Regards!

Yolo Zhu

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

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

#### Fabric Community Update - July 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors