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

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

Reply
Anonymous
Not applicable

help in dax

Need help in calculating the delta( IN SAME matrix table below) between 2020H1 and 2019 H2 from the below matrix

I have columns like 

Year: 2019, 2020

Bundle name : Mobility, Mathworks

Half year: H1, H2

Cost: the values in K

On expanding the bundles, will have employee name.

 

cghat_0-1592565598504.png

 

 

1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

Create a measure

Measure =
VAR diff =
    CALCULATE (
        SUM ( 'Table 2'[value] ),
        FILTER ( 'Table 2', 'Table 2'[year] = 2020 && 'Table 2'[half year] = "h1" )
    )
        - CALCULATE (
            SUM ( 'Table 2'[value] ),
            FILTER ( 'Table 2', 'Table 2'[year] = 2019 && 'Table 2'[half year] = "h2" )
        )
RETURN
    IF ( ISINSCOPE ( 'Table 2'[year] ), SUM ( 'Table 2'[value] ), diff )

Capture3.JPGCapture4.JPG

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

Create a measure

Measure =
VAR diff =
    CALCULATE (
        SUM ( 'Table 2'[value] ),
        FILTER ( 'Table 2', 'Table 2'[year] = 2020 && 'Table 2'[half year] = "h1" )
    )
        - CALCULATE (
            SUM ( 'Table 2'[value] ),
            FILTER ( 'Table 2', 'Table 2'[year] = 2019 && 'Table 2'[half year] = "h2" )
        )
RETURN
    IF ( ISINSCOPE ( 'Table 2'[year] ), SUM ( 'Table 2'[value] ), diff )

Capture3.JPGCapture4.JPG

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Anonymous , not very clear of the on what is the issue. You can half year in you calendar.

And this display can be a matrix

https://www.burningsuit.co.uk/blog/2019/04/7-secrets-of-the-matrix-visual/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

I want to calculate teh difference between 2020H1 and 2019 H2 in the same matrix.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.