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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
aume1
Helper I
Helper I

Finding the difference between 2 Table Visuals filtered differently through Date Slicer

Hi, 

 

I currently have 2 identical table visuals which is linked to 2 date slicers (table 1 to slicer 1, table 2 to slicer 2) so the user can compare the values in different period of time. I'd like to make a 3 table which displays the difference between these 2 tables.

Aki_umemoto_0-1628677603123.png

So from this, the third table will have the same name for all rows but shows the difference of the two tables (say table 1 - table 2).

 

My first thought was to create measure for each of the row values in table 1 and 2 that reflects the linked date slicer and create another measure that subtract measure in table 2 from the measure in table 1 but is this something possible in power bi? What would be the DAX code to create measure that reflect a specifc date slicer?

 

1 ACCEPTED SOLUTION
v-xulin-mstf
Community Support
Community Support

Hi @aume1

 

You can create a dimension table as:

Table 2 = 
VALUES('Table'[Date])

Create measures as:

Period 1 = 
CALCULATE(SUM('Table'[Sales]),ALLSELECTED('Table'[Date]))
Perior 2 = 
CALCULATE(SUM('Table'[Sales]),FILTER('Table','Table'[Date] in ALLSELECTED('Table 2'[Date])))
Diff = 
[Period 1]-[Perior 2]

Here is the output:

vxulinmstf_0-1628839336371.png

Please try the attached demo.

If you still have some question, please don't hesitate to let me known.‌‌

 

Best Regards,

Link

 

Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution. Really appreciate!

 

View solution in original post

1 REPLY 1
v-xulin-mstf
Community Support
Community Support

Hi @aume1

 

You can create a dimension table as:

Table 2 = 
VALUES('Table'[Date])

Create measures as:

Period 1 = 
CALCULATE(SUM('Table'[Sales]),ALLSELECTED('Table'[Date]))
Perior 2 = 
CALCULATE(SUM('Table'[Sales]),FILTER('Table','Table'[Date] in ALLSELECTED('Table 2'[Date])))
Diff = 
[Period 1]-[Perior 2]

Here is the output:

vxulinmstf_0-1628839336371.png

Please try the attached demo.

If you still have some question, please don't hesitate to let me known.‌‌

 

Best Regards,

Link

 

Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution. Really appreciate!

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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