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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
JYPARK
Frequent Visitor

Sum Group by type

Hi everyone,

 

Seeking for assistance.   I am trying to sum up the number of failure types.  However, I am not sure how I can do this.  

 

Failure.JPG

5 REPLIES 5
v-xuding-msft
Community Support
Community Support

Hi @JYPARK ,

You could try the formula if you want to count the number of failure types based on item id.

Measure  = CALCULATE(DISTINCTCOUNT('Table '[failure types]),ALLEXCEPT('Table ','Table '[item id]))

Best Regards,

Xue Ding

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

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Cmcmahan
Resident Rockstar
Resident Rockstar

You're just trying to count how many distinct item_failure_types you have? That's easy enough:

FailureTypes = DISTINCTCOUNT('Table 1'[item_failure_type])

  

I tried this method but when I select "New Column" and enter this 

FailureTypes = DISTINCTCOUNT('item_registration'[item_failure_type])
I get this error message:




Capture.JPG

@JYPARK   From your screenshots it appears that you are using direct query model. If so you cannot add columns at this time. You can only create measures. You are tryin to accomplish row context and the best way to do this is to add your logic to your model.

Don't try and create this as a new column.  Create it as a new measure.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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