Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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?
Solved! Go to Solution.
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.
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.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
67 | |
57 | |
50 | |
36 | |
34 |
User | Count |
---|---|
84 | |
74 | |
56 | |
45 | |
44 |