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
Anonymous
Not applicable

GROUPBY with Greater than or equal to

Hello, below is a small subset on how my Data Table and Lookup Tables are organized. My actual data table has 220k rows!

I will attached the Power BI File along with the Excel files.

 

The bottom three tables are my Model consisting of my Database, Class Lookup table (Relationship based on Model) and Name Lookup 100k+ Lookup table (Realtionship based on Company Name). 

 

You will notice that my Name Lookup 100k+ is composed of two rows which have the mispelled Company Name is certain instances and the Correct Company name however the list was created only for Company names which have an aggregated Amount of $100,000 or more. That represent about 1300 rows in my real data set out of the 220,000 rows. It would have been to exhausting of an excercise to correct the company names for aggregate amounts of 100,000 or less. 

Solutions Required. 1) The first Solution I require actually works without a Dax. I require to know which Model Class per Corrected Company Name equal 100,000 or more as displayed in my >= 100K (Correct Answer Table). I still require a Dax that accomplishes this so I created this Dax which outputs the Group by Dax Table in the picture. I need a modifier to eliminate a Model Class per Correct Company name that only shows a 100,000 or more. You will understand in a minute why I need a Dax for this.

 

Sales (100k+) = 
CALCULATE(
    SUM(Database[Amount]),
    GROUPBY('Class Lookup','Class Lookup'[Model Class]),
    GROUPBY(CompanyNameLookup,CompanyNameLookup[Correct Company Name])
)

 

2) The second solution I require is a Dax to aggregate the Model Class per Company Name that is less than $100,000, which was not aggregated in my 100K (Correct Answer Table)  The correct answer would appear in the <100K Correct Answer Table (Which I filtered manually). You will notice I do not use Correct Company Name but just Company name because I don`t actually need the corrected names in my output, and these are only used for a count, unlike my 100k+ where I need the correct names to appear.  
ALL.JPG

https://drive.google.com/file/d/1aBlLiyKAkLDFVIxDrSKZIPN2QoY7Ocw_/view?usp=sharing 

 

1 ACCEPTED SOLUTION
3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , For Greate than 100K try a measure like

 

sumx(filter(summarize(Database,'Class Lookup'[Model Class],CompanyNameLookup[Correct Company Name], "_1",SUM(Database[Amount])),[_1]>100000),[_1])

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
Anonymous
Not applicable

Thank you. Actually it is for >= 100K so I changed that but your solution is still creating the output for the Single Piston Class under 100,000. The correct solution should not include it.

Capture.JPG

Anonymous
Not applicable

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.