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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
shei7141
Helper III
Helper III

conditional multiply

Hi all,

 

I have a table which looks like the following

 

UniqueIDSubTotalOriginalDisNewDisNewRate
11a50010%20%Total x NewDis per Unique ID
11b 50%40% 
11c 40%40% 
22a100100%100% 

 

How can I calculate the NewRate column using dax?

 

Thanks in advance

1 ACCEPTED SOLUTION

@shei7141 here is the formula, add new column

 

New Col = CALCULATE ( MAX ( 'Table'[Total] ), ALLEXCEPT ( 'Table', 'Table'[UniqueID] ) ) * 'Table'[NewDis] 

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

22 REPLIES 22
Anonymous
Not applicable

HI @shei7141 

 

Form the limited information you have provided.

Here is what I would do.

NewRate = CALCULATE(SUM([TOTAL]*[NEWDIS]), ALLEXCEPT(TABLE,TABLE[UNIQUEID]))

and use this two columns in a matrix chart. 

Anonymous
Not applicable

Hey @shei7141 

 

Try the following. Please let me know if it works.

 

JDIBC_0-1597847700333.png

 

-JD

 

Thanks J

sorry mate,

it does not recoganises any columns and I was expecting the followings results 

shei7141_0-1597848261402.png

 

@shei7141 you replies are very confusing, in the last reply you inked the values which were already possible from my first solution. kind of confusing what you actually want



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

thanks mate

 

but with your suggestion also, the return value was 'blank' where the total value was not filled.

 

Ta,

Shei

 

 

 

@shei7141 you need to revisit your question, put an excel file, and provide the calculation with the expected result. Your question is super simple and the reply has been already made but your return replies are making it super confusing. Help us to get help

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

ok this is the story

 

MainItemTotalSubOriginalDisNewDis   
A100a110%50%   
A a215%5   
A a320%20   
A a45%15   
A a550%10   
B200b130%45   
B b225%25   
B b345%30   
        
I created the measure for Revised Fee    
        
NewTotal =
SUMX ( VALUES ('Table'[UniqueID] ),
CALCULATE ( SUM ( 'Table'[Total] ) ) * 1
        
I draw a table in Vizualisation and I get the following   
        
        
MainItemTotalSubOriginalDisNewDisNewTotal  
A100a110%50%50  
A a215%5%   
A a320%20%   
A a45%15%   
A a550%10%   
B200b130%45%90  
B b225%25%   
B b345%30%   

 

the desirable outcome is

 

MainItemTotalSubOriginalDisNewDisNewTotal
A100a110%50%50
A a215%5%5
A a320%20%20
A a45%15%15
A a550%10%10
B200b130%45%90
B b225%25%50
B b345%30%60

 

when apply the original suggestion (i.e. 

New Col = CALCULATE ( MAX ( 'Table'[Total] ), ALLEXCEPT ( 'Table', 'Table'[UniqueID] ) ) * 'Table'[NewDis]

 

I get the following 

 

MainItemTotalSubOriginalDisNewDisNewTotal
A100a110%50%150
A a215%5%15
A a320%20%60
A a45%15%45
A a550%10%30
B200b130%45%135
B b225%25%75
B b345%30%90

@shei7141 this what you shared that is not working but you are not sharing what you want? and also the original solution I posted, if you used that, what is not working? Your reply/requirement is still very unclear.

 

Read this post to get your answer quickly.

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

sure - I updated my response and included the desirable outcome

@shei7141 the solution I posted will get you this, isn't it? Did you try it?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

yes I tried both solution but they did not work

 

your first solution sumed the total and than applied the NewDis

second one only calculated the RevisedFee where Total had some number, 

 

 

@shei7141 not exactly sure about your comment on the first one, why not put a pbix file with sample data and both the solution I provided and share it with me.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

amitchandak
Super User
Super User

@shei7141 , what is expected output. Are these all column.

One solution can be a new column - but I doubt you need that

new column = [Total]*[NewDis]

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks heaps

 

I want to calculate this as a measure and expecting the return value to be (Total x new Dist)

also - my apologies, I forgot to mention, for each unique ID, the total value is only mentioned once and in the sub catergory the total is left blank

 

@shei7141 here is the formula, add new column

 

New Col = CALCULATE ( MAX ( 'Table'[Total] ), ALLEXCEPT ( 'Table', 'Table'[UniqueID] ) ) * 'Table'[NewDis] 

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

thanks Perry,

 

It returned the sum of total for each Unique ID

 

I tried the following (i.e. before multiplying with the new distributional values)

 

= CALCULATE(
MAX(Tab[Total]),ALLEXCEPT(DatabaseTab,DatabaseTab[UniqueID]))

@shei7141 I have no idea what you mean? Are you adding this a column or a measure? Why not you multiply as I expected, see screenshot below

 

parry2k_0-1597846979865.png

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

sorry for the confusion

 

I am calculating a measure.

I want to return New Col (as a measure) = total (per unique ID) x NewDis

shei7141_0-1597847158174.png

 

@shei7141 change it to measure as below

 

New Measure = 
SUMX ( VALUES ('Table'[UniqueID] ), 
CALCULATE ( SUM ( 'Table'[Total] ) ) * 
CALCULATE ( MAX ( 'Table'[NewDis] ) )
) 

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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