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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
jkhan
Helper III
Helper III

DAX Help

Dear Power BI Gurus,

 

Please help to build below DAX, I need to make sum based on condition on different Tables and Sum them together 

I tried to use below DAX but not working. 

 

TOTAL IFC ALL REVENUE ACTUAL = CALCULATE ( SUM(IFC_Monthly[Value]),IFC_Monthly[Category]="Revenue", IFC_Monthly[Period]="Actual"
+ SUM(CPU_Monthly[Value]),CPU_Monthly[Category]="Revenue", CPU_Monthly[Period]="Actual"
+ SUM(LOUNGE_Monthly[Value]),LOUNGE_Monthly[Category]="Revenue", LOUNGE_Monthly[Period]="Actual"
+ SUM(AIRLINES_Monthly[Value]),AIRLINES_Monthly[Category]="Revenue", AIRLINES_Monthly[Period]="Actual"
+ SUM(MD_Monthly[Value]),MD_Monthly[Category]="Revenue", MD_Monthly[Period]="Actual"
)

 

1.JPG

1 ACCEPTED SOLUTION

@jkhan 

Can you use this measure which I modified.

TOTAL IFC ALL REVENUE ACTUAL =
VAR ifc =
    CALCULATE (
        SUM ( IFC_Monthly[Value] ),
        IFC_Monthly[Category] = "Revenue",
        IFC_Monthly[Period] = "Actual"
    )
VAR cpu =
    CALCULATE (
        SUM ( CPU_Monthly[Value] ),
        CPU_Monthly[Category] = "Revenue",
        CPU_Monthly[Period] = "Actual"
    )
VAR lounge =
    CALCULATE (
        SUM ( LOUNGE_Monthly[Value] ),
        LOUNGE_Monthly[Category] = "Revenue",
        LOUNGE_Monthly[Period] = "Actual"
    )
VAR md =
    CALCULATE (
        SUM ( MD_Monthly[Value] ),
        MD_Monthly[Category] = "Revenue",
        MD_Monthly[Period] = "Actual"
    )
RETURN
    ifc + cpu + lounge + md
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

4 REPLIES 4
jkhan
Helper III
Helper III

Hi Fowmy,

 

I need aggregiate Sum from Different Tables like  IFC_Monthly CPU_Monthly LOUNGE_Monthly based on condidtion 
IFC_Monthly[Category]="Profit", IFC_Monthly[Period]="Actual"

 

2.JPG

 

 

@jkhan 

Can you use this measure which I modified.

TOTAL IFC ALL REVENUE ACTUAL =
VAR ifc =
    CALCULATE (
        SUM ( IFC_Monthly[Value] ),
        IFC_Monthly[Category] = "Revenue",
        IFC_Monthly[Period] = "Actual"
    )
VAR cpu =
    CALCULATE (
        SUM ( CPU_Monthly[Value] ),
        CPU_Monthly[Category] = "Revenue",
        CPU_Monthly[Period] = "Actual"
    )
VAR lounge =
    CALCULATE (
        SUM ( LOUNGE_Monthly[Value] ),
        LOUNGE_Monthly[Category] = "Revenue",
        LOUNGE_Monthly[Period] = "Actual"
    )
VAR md =
    CALCULATE (
        SUM ( MD_Monthly[Value] ),
        MD_Monthly[Category] = "Revenue",
        MD_Monthly[Period] = "Actual"
    )
RETURN
    ifc + cpu + lounge + md
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Hi Fowmy,

I used like below, Thanks for your reply. 

 

TOTAL IFC ALL PROFIT ACTUAL =
CALCULATE ( SUM(IFC_Monthly[Value]),IFC_Monthly[Category]="Profit", IFC_Monthly[Period]="Actual" )
+
CALCULATE (SUM(CPU_Monthly[Value]),CPU_Monthly[Category]="Profit", CPU_Monthly[Period]="Actual" )
+
CALCULATE (SUM(LOUNGE_Monthly[Value]),LOUNGE_Monthly[Category]="Profit", LOUNGE_Monthly[Period]="Actual" )
+
CALCULATE (SUM(AIRLINES_Monthly[Value]),AIRLINES_Monthly[Category]="Profit", AIRLINES_Monthly[Period]="Actual" )
+
CALCULATE (SUM(MD_Monthly[Value]),MD_Monthly[Category]="Profit", MD_Monthly[Period]="Actual" )

Fowmy
Super User
Super User

@jkhan 

You cannot add anything to the filter within CALCULATE like you have done + SUM ( CPU_Monthly[Value] ) .
Can you explain what is the logic that you need to apply to do the calculation also show picture of your model.




Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.