Forum Discussion
One total value in one column
- 4 years ago
Hi, Anonymous
According to your description, do you mean that you want to prioritize the current value as the total value and get the total value for each category? I think you can try to create a measure like this:
Total Sale = SWITCH( TRUE(), MAX('Table'[Current Sales ])<>BLANK(),SUM('Table'[Current Sales ]), MAX('Table'[Previous Sales ])<>BLANK(),SUM('Table'[Previous Sales ]), SUM('Table'[Current Sales ]))And you can create a table chart like this:
And you can get what you want.
You can download my test pbix file below
Thank you very much!
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.
Hi Anonymous
Try this:
measure = [Previous Sales]+[Current Sales]
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Hi, Thanks for replying. Though for my pants row my Total sales will be 420. Total Sales value should be based on the sales values in each column. i.e for pants it should be 400 not 420
- VahidDM4 years ago
Super User
Anonymous
Did you try the measure I shared before?
Appreciate your Kudos!!
- Anonymous4 years agoNot applicable
Yes, the result for pants will be 420 with that measure instead of 400
- VahidDM4 years ago
Super User
So if there is a value in Current Sales you want to use that, otherwise, you want to see the Previous Sales. am I correct? if yes, try this:
measure =
Var _CS =Sum([Current Sales])
Var _PS = SUM([Previous Sales])
return
if(isblank(_CS),_PS,_CS)If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!