Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
Regarding this post: https://community.powerbi.com/t5/Desktop/DAX-Column-if-all-links-are-implemented/m-p/3154958#M106580...
The solution i got from this topic seem to be a slow, i had to leave my laptop over night just for the column to be calculated. This would be a problem when i'll refresh my data. Is there a way to make this calculated column faster?
Solved! Go to Solution.
Hi @uif19085 ,
You can use DAX Studio to capture DAX queries and then use the Power BI Profiler.
You can refer to the following document to optimize calculated columns.
Calculated Table Columns Power BI: Tips & Best Practices (enterprisedna.co)
I recommend that you use measures instead of calculated columns, and measures perform calculations only when they are used in the report. If you don't use them, they don't take up any space in the model.
Measure =
VAR _linkids =
CALCULATETABLE (
VALUES ( 'Table 2'[LinkedID] ),
FILTER ( 'Table 2', MAX('Table 2'[ID]) = MAX('Table 1'[ID]) )
)
VAR _count =
COUNTROWS ( _linkids)
VAR _impcount =
CALCULATE (
COUNT ( 'Table 1'[Implementation] ),
FILTER (
ALL('Table 1'),
'Table 1'[UniqueID]
IN _linkids
&& 'Table 1'[Implementation] = "Yes"
)
)
RETURN
IF (
_count = _impcount
&& NOT ( ISBLANK ( _count ) ) && NOT ( ISBLANK ( _impcount ) ),
1,
0
)
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @uif19085 ,
You can use DAX Studio to capture DAX queries and then use the Power BI Profiler.
You can refer to the following document to optimize calculated columns.
Calculated Table Columns Power BI: Tips & Best Practices (enterprisedna.co)
I recommend that you use measures instead of calculated columns, and measures perform calculations only when they are used in the report. If you don't use them, they don't take up any space in the model.
Measure =
VAR _linkids =
CALCULATETABLE (
VALUES ( 'Table 2'[LinkedID] ),
FILTER ( 'Table 2', MAX('Table 2'[ID]) = MAX('Table 1'[ID]) )
)
VAR _count =
COUNTROWS ( _linkids)
VAR _impcount =
CALCULATE (
COUNT ( 'Table 1'[Implementation] ),
FILTER (
ALL('Table 1'),
'Table 1'[UniqueID]
IN _linkids
&& 'Table 1'[Implementation] = "Yes"
)
)
RETURN
IF (
_count = _impcount
&& NOT ( ISBLANK ( _count ) ) && NOT ( ISBLANK ( _impcount ) ),
1,
0
)
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
112 | |
112 | |
105 | |
94 | |
58 |
User | Count |
---|---|
174 | |
147 | |
136 | |
102 | |
82 |