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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.