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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
benqpbi
Helper I
Helper I

Divide individual values and total of same column in direct query

I have a column named comp_records, i want to divide the comp_record/total_comp_record --- which is 34
i am using direct query, could you pls help.

 

benqpbi_0-1680678424146.png

 

1 ACCEPTED SOLUTION
DOLEARY85
Resident Rockstar
Resident Rockstar

Hi,
 
use this:
 
Measure = DIVIDE(CALCULATE(SUM('Table Name'[comp_record])),CALCULATE(SUM('Table Name'[comp_record]),ALL('Table Name')))

View solution in original post

4 REPLIES 4
DOLEARY85
Resident Rockstar
Resident Rockstar

Hi,
 
use this:
 
Measure = DIVIDE(CALCULATE(SUM('Table Name'[comp_record])),CALCULATE(SUM('Table Name'[comp_record]),ALL('Table Name')))

lets say i have one more column named level which has values 1,2,3,4,5,6.
i want the measure to calculate values only if we have level - 4,5,6

You could try:

 

Measure =
DIVIDE(CALCULATE(SUM('Table Name'[comp_record]),or('Table Name'[level]=4,or('Table Name'[level]=5,'Table Name'[level]=6))),CALCULATE(SUM('Table Name'[comp_record]),ALL('Table Name'[comp_record])))
 
If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

Anonymous
Not applicable

try this measure 

Measure = SUM('Table'[comp_records])/CALCULATE(sum('Table'[comp_records]),all('Table'[comp_records]))

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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