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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
yashdsin
Frequent Visitor

Creating Difference between two Values for geographical Chart

Hi,

I have this data set and i want to create a third column called Difference like (3.10-2.70 = 0.4 )so that i could place it on the geographical chart. Could anyone help me with the Dax calculation required for the same.

 

 

 

 

1 ACCEPTED SOLUTION

Hi @yashdsin,

If you want to calculate the difference for the product per month, you could create the calcualted columns below.

Please note that you need to change the data type of Index column to be whole number after creating it.

Index = RIGHT('Table'[Sales],1)

Difference =
VAR a =
    CALCULATE (
        MAX ( 'Table'[Value] ),
        FILTER (
            'Table',
            'Table'[Index]
                = EARLIER ( 'Table'[Index] ) - 1
                && 'Table'[Date] = EARLIER ( 'Table'[Date] )
        )
    )
RETURN
    IF ( a = BLANK (), BLANK (), a - 'Table'[Value] )

Then you could create the matrix like below.

PS: We cannot achieve the same output as that in excel.

Capture.PNG

Hope this can make sense.

Best  Regards,

Cherry

 

Community Support Team _ Cherry Gao
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

6 REPLIES 6
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @yashdsin ,

Have you solved your problem?

If you have solved, could you share the solution or accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly?

If you still need help, please share your sample pbix so that we could help further on it.

Best  Regards,

Cherry

 

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

No, Actually i need to see the diffrence between two cells Subtracting Product1 & Product2 in cell B2 & B3 i should be getting results in Cell B4 and so on for all the columns C, D, E etc but i am getting it as a whole for Product1 & 2 respectively as a total which is not required. Please help as i am still a learner.

 

sample.PNG

Hi @yashdsin,

If you want to calculate the difference for the product per month, you could create the calcualted columns below.

Please note that you need to change the data type of Index column to be whole number after creating it.

Index = RIGHT('Table'[Sales],1)

Difference =
VAR a =
    CALCULATE (
        MAX ( 'Table'[Value] ),
        FILTER (
            'Table',
            'Table'[Index]
                = EARLIER ( 'Table'[Index] ) - 1
                && 'Table'[Date] = EARLIER ( 'Table'[Date] )
        )
    )
RETURN
    IF ( a = BLANK (), BLANK (), a - 'Table'[Value] )

Then you could create the matrix like below.

PS: We cannot achieve the same output as that in excel.

Capture.PNG

Hope this can make sense.

Best  Regards,

Cherry

 

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @yashdsin ,

It seems that you want to calculate the difference between the two values.

Normally, we could achieve that with three ways. You could choose the way based on your requirement.

1. Create the custom column in query editor ( columnA - column B)

2. Create the calculated column with dax ( columnA - column B)

3. Create the measure with dax.

If you still need help, please share your data sample and your desired output so that we could help further on it.

Best Regards,

Cherry

 

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

How can I attach a excel file or a pbix file in a question or reply section?

Hi @yashdsin ,

Sorry for the delay.

You could upload your data sample or pbix in OneDrive and post the link here. Do mask sensitive data before uploading.

Best  Regards,

Cherry

 

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

Helpful resources

Announcements
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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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