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
SimonCOFRA
Regular Visitor

Calculate delta value of the same column based on dynamic filter

Good day all,

 

I have a problem to figure out how to calculate new delta measure between 2 values (come from the same column) based on 2 different slicers. Dummy data example below:

Month ID       FCF       ReportingMonthA       ReportingMonthB
Jan                  10                 May                                May
Feb                 20                 May                                May
Jan                  50                  Jun                                 Jun

Feb                 100                 Jun                                 Jun
Jan                  200                 Jul                                  Jul

Feb                 500                  Jul                                 Jul

I would like to have 2 dynamic filters in visualization (ReportingMonthA and ReportingMonthB), based on what month I choose in those 2 dynamic filters, it would calculate the delta between the FCF value. I.E. If I set in ReportingMonthA a "May" and in ReportingMonthB a "Jul"; then I would like that the matrix table for MonthID in columns would show: 
MonthID "Jan" = 200 - 10 = 190
MonthID "Feb" = 500 - 20= 480.

The problem seems to be that once I set a ReportingMonthA filter on "Jul" and ReportingMonthB filter on "May" - the matrix does not return value from the table.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @SimonCOFRA ,

 

Based on your pbix, I have deleted all relationships you have built. And actually the [ReportingMonthB] column is not very necessary.

 

After doing these , please use the following formula to create measures

Month1 FCF =
CALCULATE (
    SUM ( 'FCF data'[FCF] ),
    FILTER (
        'FCF data',
        'FCF data'[Month ID] = MAX ( 'MonthID'[Month ID] )
            && 'FCF data'[ReportingMonthA] IN ALLSELECTED ( Month1[Month] )
    )
)
Month2 FCF =
CALCULATE (
    SUM ( 'FCF data'[FCF] ),
    FILTER (
        'FCF data',
        'FCF data'[Month ID] = MAX ( 'MonthID'[Month ID] )
            && 'FCF data'[ReportingMonthA] IN ALLSELECTED ( Month2[Month] )
    )
)

Calcalute the diff:

Diff = [Month2 FCF]-[Month1 FCF] 

The final output is shown below:

two months filters.PNG

 

Best Regards,
Eyelyn Qin
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

4 REPLIES 4
Anonymous
Not applicable

Hi @SimonCOFRA ,

 

Based on your pbix, I have deleted all relationships you have built. And actually the [ReportingMonthB] column is not very necessary.

 

After doing these , please use the following formula to create measures

Month1 FCF =
CALCULATE (
    SUM ( 'FCF data'[FCF] ),
    FILTER (
        'FCF data',
        'FCF data'[Month ID] = MAX ( 'MonthID'[Month ID] )
            && 'FCF data'[ReportingMonthA] IN ALLSELECTED ( Month1[Month] )
    )
)
Month2 FCF =
CALCULATE (
    SUM ( 'FCF data'[FCF] ),
    FILTER (
        'FCF data',
        'FCF data'[Month ID] = MAX ( 'MonthID'[Month ID] )
            && 'FCF data'[ReportingMonthA] IN ALLSELECTED ( Month2[Month] )
    )
)

Calcalute the diff:

Diff = [Month2 FCF]-[Month1 FCF] 

The final output is shown below:

two months filters.PNG

 

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

Many thanks @Anonymous!!!

 

the solution provided works great! 

 

Kind regards,

Simonas

amitchandak
Super User
Super User

@SimonCOFRA , Create two independent table of months and the try

 

measure =

calculate(sum(Table[FCF]), filter(Table, Table[ReportingMonthA] in values(Month1[Month])))

-

calculate(sum(Table[FCF]), filter(Table, Table[ReportingMonthB] in values(Month2[Month])))

 

How to use two Date/Period slicers :https://www.youtube.com/watch?v=WSeZr_-MiTg

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

Hi amitchandak,

many thanks for the idea. I tried to implement in the model but unfortunately it seems I still face the problem. It seems that filtering option still impacts the table, I cannot figure it out why. Just in case I attach the file - I would be eternally grateful if you could check where I do the misteps.


(link: https://drive.google.com/drive/folders/1UfAtsPg6dur4GxpVPFNNVf6QqsWR1pO7?usp=sharing)

 

Kind regards,
Simonas

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