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
mosman
Frequent Visitor

Capture Time Slicer Minimum Value

Hello all,

 

I have a table with account number, balance, transaction date, and correspondance date. In my report I have a time slicer for the transaction date, so users can see balances for the account that have transation in a date range. This works fine, but I would like to create another measure, in which I would like to use the same range in the transaction date in the correspondence date.

Is there a way to capture the date range from the transaction column (Time Slicer) in a variable and use it in a different measure for the corresponance date?

1 ACCEPTED SOLUTION
v-xicai
Community Support
Community Support

Hi @mosman ,

 

You can create measure to get the date range like DAX below:

Date range=
Var MinDate = CALCULATE(MIN(Table1[transaction date]),ALLSELECTED(Table1[transaction date]))
Var MaxDate = CALCULATE(MAX(Table1[transaction date]),ALLSELECTED(Table1[transaction date]))
Return
DATEDIFF(MinDate, MAXDate, DAY)

Best Regards,

Amy

 

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

4 REPLIES 4
v-xicai
Community Support
Community Support

Hi  @mosman ,

 

Does that make sense? If so, kindly mark the proper reply as a solution to help others having the similar issue and close the case. If not, let me know and I'll try to help you further.

 

Best regards

Amy

v-xicai
Community Support
Community Support

Hi @mosman ,

 

You can create measure to get the date range like DAX below:

Date range=
Var MinDate = CALCULATE(MIN(Table1[transaction date]),ALLSELECTED(Table1[transaction date]))
Var MaxDate = CALCULATE(MAX(Table1[transaction date]),ALLSELECTED(Table1[transaction date]))
Return
DATEDIFF(MinDate, MAXDate, DAY)

Best Regards,

Amy

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

Refer to this. You have to create an inactive join and activate it as per need. (Not exact but similar)

https://community.powerbi.com/t5/Desktop/DATE-RANGE-SLICERS-TO-COMPARE-NETSALES-OF-A-DATE-RANGE/td-p...

 

So you will relation with both dates with the same Date/time table.

One join will be an inactive correspondence date.

Activate correspondence date in a formula using use relation.

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks.

Min max can be taken 

 

Change Date End = 
Var _endDate= Maxx(ALLSELECTED('Date'[Date Filer]),ENDOFMONTH('Date'[Date Filer]))
Var   _start_date= minx(ALLSELECTED('Date'[Date Filer]),'Date'[Date Filer]))


return
_endDate & " " & _start_date

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.