Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Sander_NL
Helper I
Helper I

Calculation based on other colum with multiple values separated by _

I would like to have a new column which, based on the new count column (= measure _MNewCount), calculates the rate calculated on the basis of the colour column in the Tariff table.

 

The source csv file delivers a  column with color_color_color convention with a different numbers of colors so can be 1 to several seperated by "_".

 

Some products have no color option. Sometimes there are also colours that do not appear in the rates table which may then be ignored. 

 

What is de best approach?

 

 Thanks in advance for your help!

 

Concept PBIX file https://www.dropbox.com/s/zjrvh66165b7khd/Color.pbix?dl=0

 

 

1 ACCEPTED SOLUTION

Hi,

 

Try this formula

 

=if(HASONEVALUE('Product'[Product]),SUM('Product'[tariff])*[_MNewCount],SUMX(SUMMARIZE('Product','Product'[Product],"ABCD",SUM('Product'[tariff])*[_MNewCount]),[ABCD]))

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

6 REPLIES 6
Sander_NL
Helper I
Helper I

I would like to have a new column which, based on the new count column (= measure _MNewCount), calculates the rate calculated on the basis of the colour column in the Tariff table.

 

The source csv file delivers a  column with color_color_color convention with a different numbers of colors so can be 1 to several seperated by "_".

 

Some products have no color option. Sometimes there are also colours that do not appear in the rates table which may then be ignored. 

 

What is de best approach?

 

Thanks in advance for youor help!

 

Concept PBIX file:

 

https://www.dropbox.com/s/zjrvh66165b7khd/Color.pbix?dl=0

Hi,

 

What exact numerical answer are you expecting in a new column of your visual?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi thanks for your response Ashish:

 

ProductOptionOrginal_countNew CountOutcome
Test3Green_Grey_White4125400
Test5Red_Blue392700
Test4 260
Test2Red26600
Test1Red_Blue_Grey131350

Hi,

 

You may refer to my solution here.

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

This is the result I need. One small question:

 

The total is 9.750 but when I calculated this manually it should be: 10.050.

 

 

Hi,

 

Try this formula

 

=if(HASONEVALUE('Product'[Product]),SUM('Product'[tariff])*[_MNewCount],SUMX(SUMMARIZE('Product','Product'[Product],"ABCD",SUM('Product'[tariff])*[_MNewCount]),[ABCD]))

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.