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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
eaj
Helper I
Helper I

Count occurence per ID and per type

In my dataset I have some products that consists of a base fee and then the custommer pays extra per extra item. 

The invoice data are available in a table as follow:

#InvoiceMain_ItemBase_fee_included
1ItemAYes
2ItemBNo
3ItemANo
3ItemANo
4ItemAYes
4ItemBNo

 

I want to count the numbers of missing base fees (there can only be one base fee per item and invoice. I started with this messure: 

 

 

MissingComboItems = Calculate(Count(Table[Combo_Item_Included]), Table[Combo_Item_Included] = "No")

 

 

But how do I make it count only 1 missing starting fee on #Invoice2?

Current result (Missing base fees):
ItemA = 2,  ItemB = 2

What I want:
ItemA = 1, ItemB = 2 

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@eaj 

pls try this

Measure = CALCULATE(DISTINCTCOUNT('Table'[#Invoice]),FILTER('Table','Table'[Base_fee_included]="No"))

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

2 REPLIES 2
ryan_mayu
Super User
Super User

@eaj 

pls try this

Measure = CALCULATE(DISTINCTCOUNT('Table'[#Invoice]),FILTER('Table','Table'[Base_fee_included]="No"))

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




jgeddes
Super User
Super User

You can try the following.

MissingComboItems =
var _vTable =
SELECTCOLUMNS(
    Table,
    "_row", CONCATENATE(Table[#Invoice],Table[Main_Item]),
    "_included", Table[Base_fee_included]
)
Return
COUNTX(
    FILTER(DISTINCT(_vTable),[_included] = "No"),
    [_included]
)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.