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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
pranays2
Frequent Visitor

DAX formula to calculate values from one specific row to the other

Hi,

 

I'm new to power bi especially DAX.  I've a situation where i've 1main account name, sub account name and one amoun column now i want to divide one of the value from sub account name to another total of the account name group. It's easy to do in excel pivot can i get some help on how to perform the same thing in Power Bi using DAX

pranays2_0-1664340409920.png

 

1 ACCEPTED SOLUTION

Hi @pranays2 ,

 

Please try this:

% of deposits from banks = 
DIVIDE (
    SUM ( Sheet1[Amount] ),
    CALCULATE (
        SUM ( Sheet1[Amount] ),
        FILTER (
            ALL ( Sheet1[Account Name], Sheet1[Account name Sub 1] ),
            Sheet1[Account Name] = "Deposits from banks"
        )
    )
)

 

deposits from banks only

Deposits from banks =
CALCULATE (
    SUM ( Sheet1[Amount] ),
    FILTER (
        ALL ( Sheet1[Account Name], Sheet1[Account name Sub 1] ),
        Sheet1[Account Name] = "Deposits from banks"
    )
)

 

danextian_0-1664405995230.png

 










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

4 REPLIES 4
danextian
Super User
Super User

Hi @pranays2 ,

 

Given the available information, here's what I've come up with:

=
DIVIDE (
    [Sum of Amount],
    CALCULATE (
        [Sum of Amount],
        FILTER (
            ALL (
                'Table'[Column name of the first level in the row hierarchy],
                'Table'[Column name of the second level in the row hierarchy]
            ),
            'Table'[Column name of the first level in the row hierarchy] = "Deposits from bank"
        )
    )
)

 If this doesn't work, please provide a sample data.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523#M6071... 










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Hi danextian, Thanks for the quick response unfortunately the formula you suggested didn't work i've uploaded the sample data in pbix file please find it in the link attached https://drive.google.com/file/d/1GTchy22DAs332bsTsjy8fnU1KkoGsIgR/view?usp=sharing 

Hi @pranays2 ,

 

Please try this:

% of deposits from banks = 
DIVIDE (
    SUM ( Sheet1[Amount] ),
    CALCULATE (
        SUM ( Sheet1[Amount] ),
        FILTER (
            ALL ( Sheet1[Account Name], Sheet1[Account name Sub 1] ),
            Sheet1[Account Name] = "Deposits from banks"
        )
    )
)

 

deposits from banks only

Deposits from banks =
CALCULATE (
    SUM ( Sheet1[Amount] ),
    FILTER (
        ALL ( Sheet1[Account Name], Sheet1[Account name Sub 1] ),
        Sheet1[Account Name] = "Deposits from banks"
    )
)

 

danextian_0-1664405995230.png

 










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Thanks very much danextian it's working now 🙂

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.