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
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
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.