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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
gritman
Frequent Visitor

DAX - How to use a Column Value to use in a Measure

Hello everyone, 

 

I would very much appreciate any help and advice on the following please.

 

I have a table and would like to perform some calculations, the inputs to which will change, depending on slicer values.  I think I therefore need to use Measures instead of Columns (?).

 

Below is an example:  the first 3 columns are imported data.  The measure is a sum of the $ Amount per Sales Person - which I performed using CALCULATE(SUM(Sales[$ Amount]), ALLEXCEPT(Sales, Sales[Salesperson]))

 

What I now want to do is $ Amount / Total (e.g. for row 1:  200 / 1000) however I can't seem to do this in DAX.  I've been reading and I understand that is because I can't pass a table as a parameter (I tried (Divide(Table[$Amount], Measure.Total), 0) but that didn't work). 

 

Please can someone advise on a measure that will perform Table.$ Amount / Measure.Total for each row.

Table.DateTable.SalespersonTable.$ AmountMeasure.TotalMeasure.Day % (Help)
1st FebBob200100020%
1st FebJessica200120017%
2nd FebBob300100030%
2nd FebJessica400120033%
3rd FebBob500100050%
3rd FebJessica600120050%

 

The reason I want a measure rather then a Column is so I can have a slider on the date so that if I was to change the date range to just 1st Feb and 2nd Feb as below, the Day % would change.

 

Table.DateTable.SalespersonTable.$ AmountMeasure.TotalMeasure.Day % (Help)
1st FebBob20050040%
1st FebJessica20060033%
2nd FebBob300100030%
2nd FebJessica400120033%

 

Any help would be greatly appreciated.

 

Thanks

 

Gritman

1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@gritman add following measures, Total Sales and % Sales

 

 

Total Sales = 
VAR __salesPerson = MAX( Table[Salesperson] )
RETURN
CALCULATE(SUM(Table[$ Amount]), 
ALLSELECTED( Table ), 
Table[Table.Salesperson] = __salesPerson )

% Sales = DIVIDE( SUM( Table[$ Amount] ), [Total Measure] )

 

 



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

2 REPLIES 2
parry2k
Super User
Super User

@gritman add following measures, Total Sales and % Sales

 

 

Total Sales = 
VAR __salesPerson = MAX( Table[Salesperson] )
RETURN
CALCULATE(SUM(Table[$ Amount]), 
ALLSELECTED( Table ), 
Table[Table.Salesperson] = __salesPerson )

% Sales = DIVIDE( SUM( Table[$ Amount] ), [Total Measure] )

 

 



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.

Hi Parry2k, 

 

That worked!  Many, many thanks.

 

Rgds

 

Gritman

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 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.