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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
Employee
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
Employee
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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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