Forum Discussion
Total is empty
- 5 years ago
I resolved the issues finally.
First of all, I am not completely sure of what change fix the bug but, I created measures separated instead of using Variables in the same measure because I think it created some errors.After, I separated a little the code proposed by amitchandak (thank you!) to understand it better and here is the code:
VAR T_ProgramName = SUMMARIZE('Dim_Project Database', 'Dim_Project Database'[Project Type], 'Dim_Project Database'[Program Name]) VAR T_SubTotal= ADDCOLUMNS(T_ProgramName, "Col_Estimado", [Estimated_Resources], "Col_OtrosProyectos",SWITCH( [Program Name], "Non billable" , IF(PendingResources<=0, 0, IF( PendingResources >= NonBillingResourceCost, NonBillingResourceCost, PendingResources)), "Internal Project", IF(( PendingResources - NonBillingResourceCost) >0,PendingResources - NonBillingResourceCost,BLANK()), BLANK() ) ) VAR Total_Cost = SUMX(T_SubTotal, IF([Col_OtrosProyectos] = BLANK(), [Col_Estimado], [Col_OtrosProyectos])) RETURN Total_Cost
MacarenaGB , Try like
Total_Estimated_Resources =
Sumx(summarize('Dim_Project Database', 'Dim_Project Database'[Program Name],'Dim_Project Database'[Project Type], "_1", IF(
ISINSCOPE('Dim_Project Database'[Program Name]) ,
SWITCH(
SELECTEDVALUE('Dim_Project Database'[Program Name]),
"Non billable" , NonBillingResourceCost,
"Internal Project", PendingResources - NonBillingResourceCost,
BLANK()
)
+
IF(HASONEVALUE('Dim_Project Database'[Program Name]), Estimated_Resources,BLANK())
,BLANK()
)),[_1])
MacarenaGB , try like
Total_Estimated_Resources =
Sumx(summarize('Dim_Project Database', 'Dim_Project Database'[Program Name],'Dim_Project Database'[Project Type],'Dim_Project Database'[Year],'Dim_Project Database'[Month], "_1", IF(
ISINSCOPE('Dim_Project Database'[Program Name]) ,
SWITCH(
SELECTEDVALUE('Dim_Project Database'[Program Name]),
"Non billable" , NonBillingResourceCost,
"Internal Project", PendingResources - NonBillingResourceCost,
BLANK()
)
+
IF(HASONEVALUE('Dim_Project Database'[Program Name]), Estimated_Resources,BLANK())
,BLANK()
)),[_1]) - MacarenaGB5 years agoHelper II
Hi!
I tried that before but I can't access to the Calendar columns (it is other table)
- MacarenaGB5 years agoHelper II
amitchandak any solution?
Thanks!
- v-robertq-msft5 years agoCommunity Support
Hi, MacarenaGB
I think you can change the columns that you circled in the DAX formula to
'Dim_Project Database'[Year],'Dim_Project Database'[Month]If you still have a problem, you can post some sample data(without sensitive data) and your expected result.
How to Get Your Question Answered Quickly
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.