Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
I am trying to count the number of floors per building per facility. I am using two measures to get this but it is not working
Any help would be greatly appreciated.
Solved! Go to Solution.
@Anonymous This is because you have [Floor] still in the table. A couple of things you can do, either use a matrix visual instead to get the subtotals;
[Count of Floors] in Values
[Facility] in Rows
[Building] in Rows
[Floor] in Rows
Expand down to all levels using the double connected arrows (looks like a fork kind of) at top of matrix.
or update your measure:
Count of All Floors = CALCULATE(COUNTA('public facilities'[name]) , ALL('public facilities'[floor]))
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
@AllisonKennedy I created the measure count of floor ( COUNTA('public facilities'[name]) ). I am still not geting the floors to total up. If you look at the first one there is 2 garages with 6 floors each. I am needing it to be North Garage 6 floors and West Garage 6 Floors.
@Anonymous This is because you have [Floor] still in the table. A couple of things you can do, either use a matrix visual instead to get the subtotals;
[Count of Floors] in Values
[Facility] in Rows
[Building] in Rows
[Floor] in Rows
Expand down to all levels using the double connected arrows (looks like a fork kind of) at top of matrix.
or update your measure:
Count of All Floors = CALCULATE(COUNTA('public facilities'[name]) , ALL('public facilities'[floor]))
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
@Anonymous The countifs in DAX comes down to how you use it, if you want to count number of floors, simply create a measure:
Count of Floors = COUNTA('public facilities'[name])
Then put this in a table or matrix visual. If using a matrix, put:
[Count of Floors] in Values
[Facility] in Rows
[Building] in Rows
If using a table, just put them in this order:
[Facility]
[Building]
[Count of Floors]
If you want distinct count, use @camargos88 formula.
You can also use the COUNTROWS formula you have already created if you want to include blank values in your count.
Hope that makes sense?
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
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 |
---|---|
84 | |
75 | |
68 | |
41 | |
35 |
User | Count |
---|---|
102 | |
56 | |
52 | |
46 | |
40 |