Forum Discussion

Varun511's avatar
Varun511
Icon for Helper I rankHelper I
4 years ago

USE Relationship for date filter

HI ,

 

Below is my issue

 

Have 2 dates in my table (Go Live Date , Transaction date) and I joined date table with  Transaction date 

but i need to Filter out the crosstab with with conditon ( GO Live Date <= Selected date from Slicer ) For suppose in  below example date slicer i have selected May 1st till 31st but if you can see the GO Live date 10-06-2022 which shouldnt be there 

the reason it is showing  because we have a join with Transaction date we dont have join with Go Live Date 

Created inactive relation ship from date table to Go Live date  but how to  use USE RELATIONSHIP Function for filter (Go Live date<= selected date slicer) Beacuase use relation will only work in Calculate 

 

Any help would be Highly Appreciated.Thanks

 

 

7 Replies

  • Alright, i think this will do the trick:

    Just add the measure to the visual level filter pane and go from there

  • It's a good idea to include sample data, as solutions may vary depending on data structure.

    Measure = 
    Var _MaxDate = Max(calendar[date])
    Var _GoLivedate = Max(Table[GoLiveDate])
    Var _Result = If(_GoLiveDate > _MaxDate, 0,1)
    Return
    _Result // Add to filter pane and remove all who return 0

     You'll probably also need to incorpora the same for minimum date

    • Varun511's avatar
      Varun511
      Icon for Helper I rankHelper I

      Hello,

       

      its not working its always showing  1  .i have active relationship with Trasaction date not with Go Live date so in date slicer when i try to filter Actual go live date willl not work since there is no join somehow we need to  create this filter (golive date< max date from slicer) by using userelationp  (changing context from Transaction date with Go Live date ) with go live date

      • NickolajJessen's avatar
        NickolajJessen
        Icon for Solution Sage rankSolution Sage

        Are you able to share a .pbix or dummy .pbix through dropbox for your preferred sharing service?