Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
ghe7549
Helper III
Helper III

Count number of IDs that do not have a subtype

I currently have 180 distanct facilities numbers(facilities) and i am trying to find out how many of those 180 ID's do not have a subtype.  Currently there are 437 different subtypes(subtypes).  These 2 tables are dimension table for the fact table(Assets).

The table names are in parentheses.  Facilities and subtypes and connected via their id in the asset table.  I am lost to how to figure this issue out any help would be wlecomed.

6 REPLIES 6
ghe7549
Helper III
Helper III

Below is one of the subtypes that i am trying to get a count for.  There are a total of 180 facilities but as you see there are only 11 that has this subtype. 

 

What is the best way to sum subtype column and then have a percentage based on the total number of facilities

FacilitySubtypeCount of Tag NumberCritical Infrastructure
Facility 1Generator Quick Connect Cabinet1TRUE
Facility 2Generator Quick Connect Cabinet3TRUE
Facility 3Generator Quick Connect Cabinet1TRUE
Facility 4Generator Quick Connect Cabinet1TRUE
Facility 5Generator Quick Connect Cabinet1TRUE
Facility 6Generator Quick Connect Cabinet1TRUE
Facility 7Generator Quick Connect Cabinet1TRUE
Facility 8Generator Quick Connect Cabinet2TRUE
Facility 9Generator Quick Connect Cabinet1TRUE
Facility 10Generator Quick Connect Cabinet1TRUE
Facility 11Generator Quick Connect Cabinet1TRUE

Hi,

What exact result are you expecting?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

At the end of the day i would like to have the number of facilities that do not have that subtype.  If there is a total of 200 facilities but 11 have the subtype i would like to have a card of something that shows 189 do not.

Hi @ghe7549,

How did these records store? Did those records that did not include the subtypes saving in your table with blank subtype field value or not existed in your table?
Notice: these two scenarios used different logic and expressions to calculate.

For the first one, you can calculate records with blank subtypes and use all records minus them to get the difference.

If you mean the second one, you need to get the list of subtype records and use except function to compare with all records and subtype records to get the difference.
Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
v-shex-msft
Community Support
Community Support

Hi @ghe7549,

Can you please share a pbix or some dummy data that keep raw data structure with expected results? It should help us clarify your scenario and test to coding formula.

How to Get Your Question Answered Quickly  

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Ashish_Mathur
Super User
Super User

Share some data to work with and also show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.