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
johnsmith92
Regular Visitor

Divide the sum of a column member by the total of all columns

Hi all,

 

I am new to PowerBI (coming from Tableau) and I am struggling with creating a DAX measure.

 

So, first off, my data comes from a tabluar cube and a huuuuuge model and unforunately I can't share it, but I'll do my best to describe. My Values come from a huge table with records and are already summed in the model before loading to PowerBI. My Months come from the standard Date table in the model.

 

Here's what I'm trying to replicate in PowerBI (the last row):

screen1.png

 

Basically, this calculates the total share of each month for the last 4 years.

 

My target visual in PowerBI is this:

target1.PNG

 

I have tried a lot of things, but the only thing that worked is that I managed to replicate the Excel table (with % share instead of values) and it was dependent on the years included in the matrix (which I don't need). What I'm looking for is the last row with the blue text.

 

I tried to recreate the data in a pbix file: PBIX file 

 

Can you guys help me with this one?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi@johnsmith92,

 

please try measure like this :

Measure = 
var a=
CALCULATE(
    SUM('Values'[Values]),
    FILTER(
        'Values',
        MONTH('Values'[Date])=MONTH(MAX('Values'[Date]))
    ))
var b=
CALCULATE(
SUM('Values'[Values]),ALL('Values'))
return
IF(
    HASONEVALUE('Date'[MonthName]),
    a/b,
    1
)

 

then you will get :

555.png

 

Here is the demo ,please try it : https://qiuyunus-my.sharepoint.com/:u:/g/personal/admin_qiuyunus_onmicrosoft_com/EQDTU6PV8wRKvuQOxRT... 

 

 

Hope it helps.

 

Best Regards,
Caitlyn Yan

 

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

8 REPLIES 8
johnsmith92
Regular Visitor

I can get the value only for one month, as seen here:

 

Spoiler
test14.png

Understandibly it doesn't work:

 

 fadf.PNG 

Not sure if that's possible, but I want the above "Sum Months" calculation to replicate itself, depending which row is on the first column and replace the month part.

amitchandak
Super User
Super User

@johnsmith92 , you file is not opening, can you share the formula

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

Could it be because I'm on January 2021 version?

@johnsmith92 , I am not Feb 2021, so it should open. Please share formula/measures, I will try to check

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

Have you been able to open the file, sir?

Anonymous
Not applicable

Hi@johnsmith92,

 

please try measure like this :

Measure = 
var a=
CALCULATE(
    SUM('Values'[Values]),
    FILTER(
        'Values',
        MONTH('Values'[Date])=MONTH(MAX('Values'[Date]))
    ))
var b=
CALCULATE(
SUM('Values'[Values]),ALL('Values'))
return
IF(
    HASONEVALUE('Date'[MonthName]),
    a/b,
    1
)

 

then you will get :

555.png

 

Here is the demo ,please try it : https://qiuyunus-my.sharepoint.com/:u:/g/personal/admin_qiuyunus_onmicrosoft_com/EQDTU6PV8wRKvuQOxRT... 

 

 

Hope it helps.

 

Best Regards,
Caitlyn Yan

 

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

That works perfectly! Thank you so much!

Hi @amitchandak . There's no formulas for the data, I have just put it in PowerBI manually. Can you try this again? New PBIX file 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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