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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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