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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
tondeli
Advocate I
Advocate I

How to calculate difference after different filter settings..?

Here is some background about my problem:

  • I have two value columns in my data: value1 and value2. These both values are exaclty the same.
  • I have two column chart visualizations in my report with month in axis. In the first visualization value is value1 and in the second visualization value is value2.
  • I have two cost center slicers in my report. I control the first visualization with the slicer1 and the second visualization with slicer2.

For example:

  • First visualization shows total value of 500 (cost center=asia)
  • Second visualization shows total value of 300 (cost center=europe)
  • Difference = 200

My problem is that I don't know how to calculate difference between my values. I think that I need to calculate difference after filtering. Is there anyway to do this (Tableua can handle this with paramenters)?

1 ACCEPTED SOLUTION
v-yuezhe-msft
Microsoft Employee
Microsoft Employee

Hi @tondeli,

What is your table structure and could you please share sample data of your table?

If your table is similar as follows, you can duplicate the current table in Query Editor, then filter the first table to contain only Europe data and the second table to contain only Asia data.
1.PNG

After that, create a column using the following DAX in europe table, then create a column chart as shown in the screenshot below.

Difference = RELATED('asia'[Value1])-europe[Value1]
2.PNG


Thanks,
Lydia Zhang

Community Support Team _ Lydia Zhang
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

2 REPLIES 2
v-yuezhe-msft
Microsoft Employee
Microsoft Employee

Hi @tondeli,

What is your table structure and could you please share sample data of your table?

If your table is similar as follows, you can duplicate the current table in Query Editor, then filter the first table to contain only Europe data and the second table to contain only Asia data.
1.PNG

After that, create a column using the following DAX in europe table, then create a column chart as shown in the screenshot below.

Difference = RELATED('asia'[Value1])-europe[Value1]
2.PNG


Thanks,
Lydia Zhang

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

Lydia, this was very helpful suggestion -thank you! I created dublicate fact table and dublicated all dimension tables aswell. I use these like two different solutions inside one data model. Now everything works!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.