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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
jkhan
Helper III
Helper III

Division in Matrix

Hi, 

 

Please help me to build DAX to meet below requirement, I have created 2 MATRIX Visual Revenue and Expense

Account_ID starting with 4 is Revenue Account
Account_ID starting with 5 is Expense Account

So I have made Visual Level Filter for

Revenue Account_Type='Revenue' & Expense Account_Type='Expense'

 

I written below DAX for JAN-2022 

 

A_JAN = CALCULATE (SUM (PBI_MIS_TB[ACTUAL]), PBI_MIS_TB[A_MONTH]=1)

Now I have requirement to get Percentage of  Expense where Different Account Expenses should be divided with Total Revenue 166,801021 
 
Example :  
62,794,480 / 166,801,021
46,539,963 / 166,801,021
 
Below DAX for Revenue is working fine. 
A_JAN% = DIVIDE( [A_JAN], CALCULATE( [A_JAN] ,ALLSELECTED()) )

But below DAX for Expense is not working correctly.
E_A_JAN1% = DIVIDE( CALCULATE ( SUM (PBI_MIS_TB[ACTUAL]), PBI_MIS_TB[A_MONTH]=1,PBI_MIS_TB[TB_ACCOUNT_TYPE]="REVENUE" ), CALCULATE( [A_JAN] ,ALLSELECTED()) )


2.JPG 

 

Thanks & Regards

Jamsher

1 ACCEPTED SOLUTION
jkhan
Helper III
Helper III

Able to build the DAX working fine now. 

 

E_A_JAN% = DIVIDE( [A_JAN],CALCULATE ( SUM (PBI_MIS_TB[ACTUAL]), PBI_MIS_TB[A_MONTH]=1,PBI_MIS_TB[TB_ACCOUNT_TYPE]="REVENUE", REMOVEFILTERS(PBI_MIS_TB)) )
 
3.JPG

 

Thanks & Regards
Jamsher

View solution in original post

2 REPLIES 2
jkhan
Helper III
Helper III

Able to build the DAX working fine now. 

 

E_A_JAN% = DIVIDE( [A_JAN],CALCULATE ( SUM (PBI_MIS_TB[ACTUAL]), PBI_MIS_TB[A_MONTH]=1,PBI_MIS_TB[TB_ACCOUNT_TYPE]="REVENUE", REMOVEFILTERS(PBI_MIS_TB)) )
 
3.JPG

 

Thanks & Regards
Jamsher
jkhan
Helper III
Helper III

@amitchandak  @Whitewater100 

Dear Mr. Amit , Mr. Whitewater any suggestion please

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

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