Forum Discussion
Getting an incorrect total
Hi,
I created a column with the following: Total = IF(OR(table[ColumnA]="06TW";table[ColumnA]="05WT");table[ColumnB]*(-1); table[ColumnB]).
This works fine but when I put it within a table it gives me the wrong total for this column.
Can I write this another way to give me a correct total value?
Thank you.
- Anonymous6 years ago
Hi byrdwatcher1978 ,
You can try to use the methods in this post, then check if can return the correct total values. If still not, please provide some sample data in tables and expected values with screen shot. Thank you.
Best Regards
Rena
5 Replies
- Greg_DecklerCommunity Champion
This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376
Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907- byrdwatcher1978Helper I
Greg_Deckler , thanks. Pretty new to powerbi so trying to work it all out.
Would it be something along these lines?
m_Total 1 =
VAR __table = IF(OR(table[ColumnA]="06TW";table[ColumnA]="05WT");table[ColumnB]*(-1); table[ColumnB])
RETURN
IF(HASONEVALUE(Table1[ColumnA]),[ColumnB],SUMX(__table,[__value]))Thanks again.
- Greg_DecklerCommunity Champion
Could be but not likely because I do not see a SUMMARIZE or a GROUPBY in your formula which tends to be necessary in order to recreate the same context of the visual. So, likely what you have is not correct. But, very difficult to say 100% because I do not have a lot of information.
Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
- AnonymousNot applicable
Hi byrdwatcher1978 ,
Whether the problem has been resolved? If yes, could you please mark the helpful post as Answered? It will help other members in the community find the solution easily if they face the similar problem with you. Thank you.
Best Regards
Rena