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.
Can you help me understand the difference between
SUMX( SUMMARIZE( FACT_COST_RESOURCE_CATEGORY; FACT_COST_RESOURCE_CATEGORY[ID_DIM_PROJECT]; FACT_COST_RESOURCE_CATEGORY[ID_DIM_ACTIVITY]; FACT_COST_RESOURCE_CATEGORY[ID_DIM_RESOURCE_CATEGORY]; "COST PLANNED PROJECT"; FIRSTNONBLANK(DIM_RESOURCE_CATEGORY[COST_EQUIPMENT_BUDGET];1) + FIRSTNONBLANK(DIM_RESOURCE_CATEGORY[COST_LABOR_BUDGET];1) + FIRSTNONBLANK(DIM_RESOURCE_CATEGORY[COST_UNIT_BUDGET];1) ); [COST PLANNED PROJECT] )
and
SUMX( SUMMARIZE( FACT_COST_RESOURCE_CATEGORY; FACT_COST_RESOURCE_CATEGORY[ID_DIM_PROJECT]; FACT_COST_RESOURCE_CATEGORY[ID_DIM_ACTIVITY]; FACT_COST_RESOURCE_CATEGORY[ID_DIM_RESOURCE_CATEGORY] ); FIRSTNONBLANK(DIM_RESOURCE_CATEGORY[COST_EQUIPMENT_BUDGET];1) + FIRSTNONBLANK(DIM_RESOURCE_CATEGORY[COST_LABOR_BUDGET];1) + FIRSTNONBLANK(DIM_RESOURCE_CATEGORY[COST_UNIT_BUDGET];1) )
?
From what I can observe the second one doesn't care for the context.
I'm trying to optimize the top one and altough the second one is much faster (yay!), the results are wrong...
Have you tried using GROUPBY, which then gives you access to row context using CURRENTGROUP()
So something like:
GROUPBY( TABLE TO GROUP, GROUP BY COLUMN, GROUP BY COLUMN, ETC, "Name of New Column", SUMX ( CURRENTGROUP(), Expression ) )
Generally dont want to add columns in summarize, better to use ADDCOLUMNS and SUMMARIZE.
Thanks for the suggestion but FIRSTNONBLANK doesn't seem permitted in the GROUPBY functions...
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
97 | |
84 | |
67 | |
61 |
User | Count |
---|---|
150 | |
120 | |
99 | |
87 | |
68 |