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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
gracizach
New Member

How to group with calcs

I have the data:

 

DateInOutDepartment
01/01/2021                1.500,00 Tech
01/01/2021                1.688,00 Strategy
01/01/2021 -                1.200,00Tech
04/01/2021                   780,00 Tech
05/01/2021                   290,00 Strategy
06/01/2021 -                7.020,00Innovation
07/01/2021 -              18.500,00Global
07/07/2021 -              21.700,00Global

 

The normal result in Power BI is:

DepartmentInOut
Global                       -  -         40.200,00
Innovation                       -  -            7.020,00
Strategy          1.978,00 
Tech          2.280,00-            1.200,00

 

But i need other view too:

DepartmentInOut
Innovation + 1/3 Global                       -  -         20.420,00
Strategy + 1/3 Global          1.978,00-         13.400,00
Tech + 1/3 Global          2.280,00-         14.600,00

 

How to aggregate this way?

 

Thx in advance!

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@gracizach 

Create two measures:

In Total = 

VAR __GLOBAL = 
    CALCULATE(
        SUM(Table7[In]),
        Table7[Department] = "Global"
    )    
VAR _TOTAL = SUM(Table7[In])
RETURN
IF(
    MAX(Table7[Department] ) = "Global",
    BLANK(),
    IF(
            HASONEVALUE(Table7[Department]),
            _TOTAL + DIVIDE( __GLOBAL , 3 )
        ,
            _TOTAL
    )
)
Out Total = 
VAR __GLOBAL = 
    CALCULATE(
        SUM(Table7[Out]),
        Table7[Department] = "Global"
    )    
VAR _TOTAL = SUM(Table7[Out])
RETURN
IF(
    MAX(Table7[Department] ) = "Global",
    BLANK(),
    IF(
            HASONEVALUE(Table7[Department]),
            _TOTAL + DIVIDE( __GLOBAL , 3 )
        ,
            _TOTAL
    )
)

Fowmy_0-1635704979356.png

 



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

1 REPLY 1
Fowmy
Super User
Super User

@gracizach 

Create two measures:

In Total = 

VAR __GLOBAL = 
    CALCULATE(
        SUM(Table7[In]),
        Table7[Department] = "Global"
    )    
VAR _TOTAL = SUM(Table7[In])
RETURN
IF(
    MAX(Table7[Department] ) = "Global",
    BLANK(),
    IF(
            HASONEVALUE(Table7[Department]),
            _TOTAL + DIVIDE( __GLOBAL , 3 )
        ,
            _TOTAL
    )
)
Out Total = 
VAR __GLOBAL = 
    CALCULATE(
        SUM(Table7[Out]),
        Table7[Department] = "Global"
    )    
VAR _TOTAL = SUM(Table7[Out])
RETURN
IF(
    MAX(Table7[Department] ) = "Global",
    BLANK(),
    IF(
            HASONEVALUE(Table7[Department]),
            _TOTAL + DIVIDE( __GLOBAL , 3 )
        ,
            _TOTAL
    )
)

Fowmy_0-1635704979356.png

 



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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.