Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
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.