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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register 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
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Power BI Header Change

Power BI Header Update

Read about the exciting updates for the Power BI forum.

Top Solution Authors