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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Saranya_Tamil
Frequent Visitor

compare values of 2 tables are same or not

For every opportunity, I need to check the 'Total Existing ARR' value of opportunity table is equal to 'Total Net value' of Subscripion table or not based on below conditions.

1) start date of subscription should be before the close date of opportunity

2)End date of subscription should be after the close date of opportunity

3)If the subscription is cancelled, the cancellation date should be greater than close date of opportunity

 

Subscription table:

Opportunity Subscription Start              End                         Duration   Total Net Value   Revenue line                Cancellation Cancellation date

AA01/01/202131/12/20231210000SaaSNo 
AB01/06/202201/06/20231220000SaaSNo 
AC01/01/202131/12/20231230000Maintenance and SupportYes01/04/2023
AD01/01/202231/12/20231215000Maintenance and SupportNo 
AF01/01/202201/01/202312.0015000Maintenance and SupportNo 

 

Opportunity Table:

Customer  Opportunity  Closedate  Existing ARR SaaS  Existing ARR MS  Total Existing ARR

Customer 1A28/03/202330000                 45,000.00                    75,000.00
Customer 1B01/05/202330000                 15,000.00                    45,000.00
Customer 1C01/05/2023                  15,000.00                    15,000.00
Customer 1D01/05/2023                                -                                    -  

 

In this example, I have used the same set of subscription for all the opportunities with different close date.

 

Anyone can help in this DAX calculation please!

 

1 ACCEPTED SOLUTION
v-jingzhang
Community Support
Community Support

Hi @Saranya_Tamil 

 

You can create the following measure to get the total of 'Total Net value' that meet the requirements. Then use another measure to compare it with the 'Total Existing ARR'. 

Net Value = 
SUMX (
    FILTER (
        'Subscription table',
        'Subscription table'[Start] < SELECTEDVALUE ( 'Opportunity Table'[Closedate] )
            && (
                (
                    'Subscription table'[End] > SELECTEDVALUE ( 'Opportunity Table'[Closedate] )
                        && 'Subscription table'[Cancellation] = "No"
                )
                    || (
                        'Subscription table'[Cancellation] = "Yes"
                            && 'Subscription table'[Cancellation date]
                                > SELECTEDVALUE ( 'Opportunity Table'[Closedate] )
                    )
            )
    ),
    'Subscription table'[Total Net Value]
)
Whether equal ? = SUM('Opportunity Table'[Total Existing ARR]) = [Net Value] 

The relationship:

vjingzhang_1-1680851771271.png

vjingzhang_2-1680851960317.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

 

 

View solution in original post

1 REPLY 1
v-jingzhang
Community Support
Community Support

Hi @Saranya_Tamil 

 

You can create the following measure to get the total of 'Total Net value' that meet the requirements. Then use another measure to compare it with the 'Total Existing ARR'. 

Net Value = 
SUMX (
    FILTER (
        'Subscription table',
        'Subscription table'[Start] < SELECTEDVALUE ( 'Opportunity Table'[Closedate] )
            && (
                (
                    'Subscription table'[End] > SELECTEDVALUE ( 'Opportunity Table'[Closedate] )
                        && 'Subscription table'[Cancellation] = "No"
                )
                    || (
                        'Subscription table'[Cancellation] = "Yes"
                            && 'Subscription table'[Cancellation date]
                                > SELECTEDVALUE ( 'Opportunity Table'[Closedate] )
                    )
            )
    ),
    'Subscription table'[Total Net Value]
)
Whether equal ? = SUM('Opportunity Table'[Total Existing ARR]) = [Net Value] 

The relationship:

vjingzhang_1-1680851771271.png

vjingzhang_2-1680851960317.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

 

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.