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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Calculate Total using DAX

Hi All,

 

I'm working on a matrix table and I need to calculate Total on multiple levels. Please find the Data below.

 

Master Data:

IDClassCodeSub Class
AC02Less than 1 yearXCBBills
AC02Less than 1 yearMNBFunds
AC22Greater than 1 year Deposits

 

Source Data:

CodeValueID
XCB8912168.726AC02
MNB2556852AC02
ABC9983215AC02
OAS18558732.49AC22
OAS1001377.5AC22
OAS8739399AC04

 

Expected Result:

ClassValue
Total31029130.72
Less than 1 year11469020.73
Bills8912168.726
Funds2556852
Greater than 1 year19560109.99
Deposits19560109.99

 

2 REPLIES 2
v-shex-msft
Community Support
Community Support

HI @Anonymous,

You can create a matrix visual with class and subclass fields as row, value to value field, then power bi will auto aggregate your records based on class and subclass groups.

Create a matrix visual in Power BI - Power BI | Microsoft Docs

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
amitchandak
Super User
Super User

@Anonymous , You can take class and sub class on row and expand. Only thing is that total will come below

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.