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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Chitemerere
Responsive Resident
Responsive Resident

Grouping in Power BI

I have a called QualityFacts:

 

I have the following measure:

Screenshot 2020-06-02 at 10.23.00.png

which gives the following results put in a card:

Screenshot 2020-06-02 at 10.28.39.png

 

I need to group the values in columns "Assay API 1", "Assay API 2" and "Assay API 3".  Assay API 1 does not have any blank values as this is a mandatory field value but Assay API 2 and Assay API 3 can be blank depending on the product/record.  I have created the following grouping table called "Assay Group" which has no relationship to the QualityFacts table, i.e. a supporting or secondary table:

Screenshot 2020-06-02 at 10.25.17.png

 

The sort order column is used for sorting the "Assay Group" column which is text.  What i want to do is group the "Assay API 1", "Assay API 2" and "Assay API 3" from the "QualityFacts" table based on the "Assay Group" table above.  I am using the following measure for "Assay API 1":

Screenshot 2020-06-02 at 10.20.35.png

However the results i am getting are not what i am expecting for "Assay API 1" where i am getting the following:

Screenshot 2020-06-02 at 10.21.55.png

 As shown in the card above, the total number of samples is 126 so i expect the grouping above to give this total.  Please assist with the right measure.

 

How would i extend the recommended measure to cater for "Assay API 2" and "Assay API 3" which may contain blank values for certain products/records.

 

Best regards,

Chris

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Chitemerere , refer if this can help

https://www.daxpatterns.com/dynamic-segmentation/
https://www.daxpatterns.com/static-segmentation/
https://www.poweredsolutions.co/2020/01/11/dax-vs-power-query-static-segmentation-in-power-bi-dax-po...
https://radacad.com/grouping-and-binning-step-towards-better-data-visualization

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@Chitemerere , refer if this can help

https://www.daxpatterns.com/dynamic-segmentation/
https://www.daxpatterns.com/static-segmentation/
https://www.poweredsolutions.co/2020/01/11/dax-vs-power-query-static-segmentation-in-power-bi-dax-po...
https://radacad.com/grouping-and-binning-step-towards-better-data-visualization

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Many thanks, the first two references are great, i had to buy the book in which details are discussed and managed to solve my problem.

 

Best regards,

Chris

Further to my last response, if I put the value of the measure in a card i get the following:

 

Screenshot 2020-06-02 at 10.20.35.png

 

Screenshot 2020-06-02 at 12.54.07.png

 The above is in contrast to the values which appear in the grouped table below:

Screenshot 2020-06-02 at 10.21.55.png

 

so there is something i am getting wrong in the table.

 

Regards,

Chris

Thank you very much for your prompt response, mos appreciated.

 

My approach is similar to the first example you referred me to on "Dynamic segmentation".  The other examples are not suitable for my situation.  However the "Dynamic segmentation" example gives the same results as my approach.

 

Best regards,

Chris

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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