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

Get Fabric Certified for FREE during AI Skills Fest. This week only. Secure your voucher 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
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.