Forum Discussion
Power BI Desktop hangs when adding a column
- 9 years ago
Anonymous wrote:HI pvarley,
I think the performanc issue is related to your masure, each measure will calculate throught the UsersTenants table. If this is a case, your calculate column will calculate about almost 1,368,000,000(19,000* 36,000*2) times.
Regards,
Xiaoxin Sheng
That may be the problem. I worked around it by moving the string comparison into the query and generating two new columns in the UsersTenants table with True/False values. Now the measures just look at those two values, and the calculation is much faster. The new measures look like this:
CALCULATE( DISTINCTCOUNT( UsersTenants[Email] ),
FILTER( UsersTenants,
UsersTenants[IsProvisioningUser] = FALSE && UsersTenants[IsInternalUser] = TRUE
)
)
I created a measure with the same formula as the column, but Power BI will not allow me to use the measure as a filter in a report. That is why I'm using a calculated column.
The measures behind the column look like this:
Measure = CALCULATE( DISTINCTCOUNT( UsersTenants[Email] ),
FILTER( UsersTenants,
UsersTenants[Email] <> "[email protected]" && FIND("@example.com", UsersTenants[Email], ,0) > 0
)
)
The UserTenants table has about 36,000 rows, and the Orgs table, which is related and has the column has about 19.000 rows, so it's not a lot of data. The column takes at least 20 minutes to calculate, which seems like an eternity for 19,000 rows.
HI pvarley,
I think the performanc issue is related to your masure, each measure will calculate throught the UsersTenants table. If this is a case, your calculate column will calculate about almost 1,368,000,000(19,000* 36,000*2) times.
Regards,
Xiaoxin Sheng
- pvarley9 years agoHelper I
Anonymous wrote:HI pvarley,
I think the performanc issue is related to your masure, each measure will calculate throught the UsersTenants table. If this is a case, your calculate column will calculate about almost 1,368,000,000(19,000* 36,000*2) times.
Regards,
Xiaoxin Sheng
That may be the problem. I worked around it by moving the string comparison into the query and generating two new columns in the UsersTenants table with True/False values. Now the measures just look at those two values, and the calculation is much faster. The new measures look like this:
CALCULATE( DISTINCTCOUNT( UsersTenants[Email] ),
FILTER( UsersTenants,
UsersTenants[IsProvisioningUser] = FALSE && UsersTenants[IsInternalUser] = TRUE
)
)