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
BItoken
Helper III
Helper III

Need to add same date selectors in a matrix or table visual

Hi all,

 

I have a requirement where we need to have a table to show data difference between 2 dates (Snapshot Data)

We need to see the difference in $$ amount between 2 dates of date inserted (data for the captured date).

The user will have the ability to select 2 different dates from the snapshot tabe to see the differences.

 

Is there any way this can be achieved?

 

Thanks in Advance. 

9 REPLIES 9
v-kelly-msft
Community Support
Community Support

Hi @BItoken ,

 

I agree with what suggested by @amitchandak .You need 2 date tables as slicer.

Could you pls provide some sample data for test?

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

Hey thank you both for the response.

This is what i am actually looking for int he screen shot below.

 

I have daily snapshot of data and i need to display so user can select date to see what changed between 2 dates 

 

BItoken_1-1625961631908.png

 

 

Hi  @BItoken ,

 

Sorry,I misunderstood your requirement before.

Check my steps below:

First create a date table for users to select.

Then create a measure as below:

 

Measure = 
var _maxdate=CALCULATE(MAX('date'[date]),ALLSELECTED('date'[date]))
var _mindate=CALCULATE(MIN('date'[date]),ALLSELECTED('date'[date]))
var _diff=CALCULATE(SUM('Table'[value]),FILTER('Table','Table'[date]=_mindate))-CALCULATE(SUM('Table'[value]),FILTER('Table','Table'[date]=_maxdate))
var _count=CALCULATE(DISTINCTCOUNT('date'[date]),ALLSELECTED('date'[date]))
Return
IF(ISINSCOPE('Table'[date]),CALCULATE(SUM('Table'[value]),FILTER('Table','Table'[date] in FILTERS('date'[date]))),
IF(_count<>2,BLANK(),
IF(_diff>0,_diff,"("&ABS(_diff)&")")))

 

And you will see:

vkellymsft_0-1626773258331.png

vkellymsft_1-1626773332563.png

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

 

@v-kelly-msft  Thanks for the response. I tried your proposed solution but my table does not show any records when i add that measure

Can i send u the file im working on to ur inbox?

Hi  @BItoken ,

 

Sorry for the late reply.

Yes,pls remove the confidential information and share us a public link to access it.

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

 

amitchandak
Super User
Super User

@BItoken , Based on what I got.

You need to have 2 date tables one of them can be joined and one independent. If you need two slicer for same date 

 

I explained here

Need of an Independent Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI

 

 

In case you need one slicer for two different date columns, you need one date table and use userelationship 

https://radacad.com/userelationship-or-role-playing-dimension-dealing-with-inactive-relationships-in...

Hi @amitchandak, Thanks for the response. I looked at the video on the blog but i dont think it would serve my purpose or would it.

 

This is what i am actually looking for Check the screen shot below.

 

I have daily snapshot of data and i need to display so user can select date (may be 2 slicers) to see what changed between the 2 selected dates. 

 

BItoken_0-1626051175860.png

 

 

 

Hi  @BItoken ,

 

Have you checked my last reply?Is your issue solved now?

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

Hi  @BItoken ,

 

Could you pls provide some sample data for test?Better with expected output.

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

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.