Forum Discussion
Need help fixing Dax measure
Hi community, I need help with following problem,
Actual Data:
Result I am getting:
Result Required:
Thank you for help.
8 Replies
- hummingbird
Helper II
Can you please provide more information about the DAX code you have written and your desired outcome in Power BI? This will help me better understand what you are trying to achieve and how I can assist you. Meghbajaj, I would appreciate it if you could share more details about your project.
- MeghbajajFrequent Visitor
Hi hummingbird, thanks for your response.
I am trying to get the Total (Sum) of Salary by Plan Type. Total Salary = Base + Rent + Phone with respect to the Salary Start Date. Through my Dax forumula using Sum/Sumx, I am getting Total Salary = 3750 ie. 1000+1000+1000+200+200+200+50+50+50. However, what i need is 1000+200+50. I hope it makes sense.
- grantsamborn
Solution Sage
Have you considered a calculated column?
cTotal_Salary = VAR _ID = TableName[ID] VAR _Date = TableName[Date] VAR _Result = SUMX( FILTER( ALL( TableName ), TableName[ID] = _ID && TableName[Date] = _Date ), TableName[Salary] ) RETURN _ResultIf you use this column in a table or matrix, you might have to adjust the aggregation for the total line.
Let me know if this helps.
- smpa01
Community Champion
Measure = CALCULATE(SUMX(ALL(tbl[salary]),[salary]),ALL(tbl))