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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
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.

Top Solution Authors