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! Request now

Reply
KLBR
New Member

Calculate Slope based on Filters (same Field) PowerBI/DAX

Hi,

i want to calcualte the sloe ( (v1-v2) /v2) but like more dynamically in PowerBI. The User can/should select 2 Filters (FY) and it should show the value, which is filtered by Regions - ask anything if you need more informations. Table/Matrix looks like this:

"Imagin correct and not blank values"

KLBR_0-1734449445987.png

DimRegion (RegionName) , DimDate (YearLabel), DimTransactions (Value)

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @KLBR 

Based on your description, You can refer the follwing sample.

Sample data.

Data Table.

vxinruzhumsft_0-1734486893579.png

Date table

vxinruzhumsft_1-1734486915479.png

Region Table.

vxinruzhumsft_2-1734486939107.png

 

Relationship

vxinruzhumsft_3-1734486952079.png

Create a measure

MEASURE =
VAR a =
    CALCULATE (
        SUM ( Data[Value] ),
        OFFSET ( -1, ALLSELECTED ( DimDate[Year] ), ORDERBY ( [Year], ASC ) )
    )
RETURN
    DIVIDE (
        a - CALCULATE ( SUM ( Data[Value] ) ),
        CALCULATE ( SUM ( Data[Value] ) )
    )

Then put the following field to a matrix visual.

vxinruzhumsft_4-1734487040308.png

Output

vxinruzhumsft_6-1734487229937.png

 

Best Regards!

Yolo Zhu

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

1 REPLY 1
Anonymous
Not applicable

Hi @KLBR 

Based on your description, You can refer the follwing sample.

Sample data.

Data Table.

vxinruzhumsft_0-1734486893579.png

Date table

vxinruzhumsft_1-1734486915479.png

Region Table.

vxinruzhumsft_2-1734486939107.png

 

Relationship

vxinruzhumsft_3-1734486952079.png

Create a measure

MEASURE =
VAR a =
    CALCULATE (
        SUM ( Data[Value] ),
        OFFSET ( -1, ALLSELECTED ( DimDate[Year] ), ORDERBY ( [Year], ASC ) )
    )
RETURN
    DIVIDE (
        a - CALCULATE ( SUM ( Data[Value] ) ),
        CALCULATE ( SUM ( Data[Value] ) )
    )

Then put the following field to a matrix visual.

vxinruzhumsft_4-1734487040308.png

Output

vxinruzhumsft_6-1734487229937.png

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

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.

Top Solution Authors
Top Kudoed Authors