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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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