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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
kkashiv
Frequent Visitor

Trying to multiply columns of with different constants

I would like to create a stacked bar chart visualization that takes different values of Commodity( Electric, Natual Gas, Steam, etc). However all the values are in a different unit and I would like multiple specific constant to each column so that they are in the same unit. 



comm_post.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I am able to multiply all columns by a constant by using this DAX expression:
comm_post2.jpg

 In this case, the constanst is 3.

 

However, each of these column is to be multiplied with a different constant to normalize the values.

 

 

Is there a way to achieve this?

 

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

Does this measure work

=if(max(commodities[Commodity])="Electric",[Bill_line_item_values]*3,if(max(commodities[Commodity])="Natural Gas",[Bill_line_item_values]*2,[Bill_line_item_values]*5))

I have assumed that Bill_line_item_values is an explicit measure you have written.


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

View solution in original post

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

Does this measure work

=if(max(commodities[Commodity])="Electric",[Bill_line_item_values]*3,if(max(commodities[Commodity])="Natural Gas",[Bill_line_item_values]*2,[Bill_line_item_values]*5))

I have assumed that Bill_line_item_values is an explicit measure you have written.


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

Thanks for your comment. The DAX expression gives out a syntax error.

kkashiv_1-1685514639116.png

So I tried to rectify this but this says that the max function can only accept columns as an argument.

kkashiv_0-1685514594371.png

 

You are welcome.  I did not close the bracket of the Max function.  I have edited my original post.  Please copy and paste the formula again.


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

The above DAX worked. Thank you. 

Hi,

I cannot visualise the problem.  Share the download link of the PBI file and show the problem clearly.


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

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors