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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Anonymous
Not applicable

Referenced table or GROUPBY table

Hi all,

 

I have a scenerio whereby I have a Master table (MasterCodes) with a list of codes organised by Identifier TYPE (Catalogue/SubCat/Format etc). Currently I split this table into 10 individual tables, referencing the Master table, to create a table for each Identifier.

e.g.

let
Query = MasterCodes,
TYPE = Table.SelectRows(Query, each ([Identifier] = "SubCat"))
in
TYPE

 

My model is getting quite large and PBI takes ages to respond, so I'm trying different ways to improve.

 

Is the above method the best way, or should I create a dax table with GROUPBY? What performance benefits would I get from either?

e.g.

Table_SubCat = FILTER(GROUPBY(MasterCodes, MasterCodes[Identifier], MasterCodes[Code], MasterCodes[Description]), MasterCodes[Identifier] = "SubCat")
Table_Format = FILTER(GROUPBY(MasterCodes, MasterCodes[Identifier], MasterCodes[Code], MasterCodes[Description]), MasterCodes[Identifier] = "Format")
 
The splitting of the tables is required for references.
I have a table called Panel, which has various fields relating to different Codes, (Catalogue, SubCat, Format etc). Since I can't have a filter on a relationship in the model I need to have them in different tables.
 
Screenshot_5.png
 
The original SQL would have looked like this:
 
from Panels p
left outer join MasterCodes ms1 on ms1.Code = p.FormatCode and ms1.Identifier= 'Format'
left outer join MasterCodes ms2 on ms2.Code = p.SubCatCode and ms2.Identifier= 'SubCat'
 
 
 
4 REPLIES 4
v-yingjl
Community Support
Community Support

Hi @Anonymous ,

If you've fixed the issue on your own please kindly share your solution. If the above posts help, please kindly mark it as a solution to help others find it more quickly. Thanks!


Best Regards,
Yingjie Li

v-yingjl
Community Support
Community Support

Hi @Anonymous ,

I prefer you to use Table.selectrows() in power query:

  1. Power query statement cleans the undering data of your model, although it could take a long time if your model is very large, you can get a succinct data table and use it to create another tables and visuals by dax easily.
  2. Dax query statement only process surface data of your model. For example, if your model is very large without any filter, it will fully load into power bi and dax will calculate all of your data based on your model. If you use groupby to create other tables, it could take such a longer time than power query.

In conclusion, if your model is very large, using power query to clean data in advance is better than using dax directly, although both of them can get the same result finally.

 

You can also refer these articles about differences between dax and power query in details:

  1. Do You Know the Differences Between M and DAX in Power BI? 
  2. M or DAX? That is the Question! 

Best Regards,
Yingjie Li

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

Pragati11
Super User
Super User

Hi @Anonymous ,

 

First thing, why you are creating multiple tables for different TYPE from your master table?

What kind of visualisations you are trying to achieve using these individual tables?

 

Please answer above in order to understand what you are trying to acive in these tables.

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Anonymous
Not applicable

I've updated the original post

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.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors