Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
In original table, I have 3 customers (A, B, C). Based on these 3 customers, I created a measure called "new_sales" which includes the data for the original A,B,C and calculated 2 additonal sales for customers (D, E) by adding sales of A+B = D customer and B-C=E customer. I created new measure using VAR and SWITCH. Something like:
new sales =
VAR _A = calculate (sum (sales), customer = "A")
VAR _B = calculate (sum (sales), customer = "B")
VAR _C = calculate (sum (sales), customer = "C")
VAR D = _A + _B
VAR E = _B - _C
VAR final_sale = switch( [customer],
"A", _A,
"B", _B,
"C", _C,
"D", _D,
"E", _E)
RETURN
final_sale
In matrix table using a dimension table for customer which has customer A,B,C,D,E, "new_sales" measure only show sales for customer A,B,C. The new customers D,E wouldn't appear. This problem is driving me nuts. This is my first time posting. I am new to power bi. Please help.
Solved! Go to Solution.
Sorry i forgot to answer to a previous question:
TotalSales is a column in dim_customer list, not in sales
Hi,
try something like this calculated column in Customer:
If this post is useful to help you to solve your issue consider giving the post a thumbs up
and accepting it as a solution !
Unfortunately it didn't work.
Just like before, it works if it's a standalone table. However, when there's a slicer switching from customer to customer, the customer D & E do not show up.
Hi, in my exemple they show up because i created customer D & E in the customer table.
You need to add customer D & E in the customer table and then, if there is a relationship between customer and sales, it'll function.
Thanks but I do have a relationship between them. The dim_customer table has customer D & E but the original table doesn't. Please see the diagram.
Sorry, but in your diagram there is only one table, one measure and one "matrix table" that i suppose i a matrix visual. Only by calculating a measure or adding a calculated column you don't add the needed customer.
If in my exemple i start without client D & E i need to create the 2 new customer by something like this (it's a new table)
Hi. Is there a way I can upload pbix?
The syntax is incorrect.
try to upload file
https://community.powerbi.com/t5/Desktop/upload-pbix/m-p/1171649#M528305
Unfortunately my company has blocked the upload site.
I think with an email address I can send you a link to this pbi on our sharepoint but I'm not certain it's going to work.
Sorry i forgot to answer to a previous question:
TotalSales is a column in dim_customer list, not in sales
OMG. it worked!!!! You are awesome. Thank you so much!
Thank you Serpiva64. Unfortunately I am away for a week. I will test it out next weekend and let you know. Thanks again. Lisa
Hi,
can you post the measure "new_sales"?
Hi. serpiva64. We are on the same page. Just posted my measure for "new_sales" Thanks!
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.