Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Use a single date range slicer for several visualizations with different date ranges.

Hello all.

 

I am new to power bi and coming from gds. I am sorry in advance for comparisson but the idea is to explain myself better for effective comprehension of my doubt.

 

I have a dashboard with 3 KPIs cards (sales, revenue and collection) and all of them with different and independent dates in the same table but different columns.

 

In gds I am able to assign a date range dimension to every metric (KPI) and insert a generic date range slicer and once I set it to an specific range of date all KPI shows the sepecific value within its corresponding date range assigned.

 

In power bi I can see that I can configure filters at visualization, page and report levels. So if I need to see the behaviour in last week of my KPIs then I would need to change all 3 filters at visualization level for last week.

 

Is there a way in power bi to insert a single date range slicer and al kpi show the corresponding value to its specific date range?

 

Thanks in advance for your support,

  • parry2k's avatar
    parry2k
    6 years ago

    Anonymous this is ok to have an inactive relationship, you can have only one active relationship between tables, to use inactive relationship in your calculation, use userrelationship function, for example where a relationship is inactive, you will create measure sometimes like this:

     

    Measure 2 = 
    CALCULATE ( 
    SUM ( Table[Amount] ),
    USERELATIONSHIP ( TableDate[Date], Table[BrandDate] ) --this will name of the column with inactive relationship
    ) 

     

    likewise, you will create 2nd measure for 2nd inactive relationship, in your visual, use date from date table, and these measures and all will work as expected.

     

    I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

     

     

8 Replies

  • vanessafvg's avatar
    vanessafvg
    Icon for Community Champion rankCommunity Champion

    if you create a date table

     

    ie  in the modelling table select a new table and  in the calculation window type date = calendarauto(), this will create a table called date and automatically pick up all the dates in your model, as long as they are all date data types  and then in the relationships screen link each date in each table to this new date in the table called date

     

    then you build the slicer off the new table 

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks for your support.

       

      When trying to create relationship only 1 of 3 gets active and whe trying to activate other 3 relationships I get an error message saying "You can't create a direct active relationship between Opportunity and Brand because that would introduce ambiguity between tables .... and ...."

       

      3 date columns are in one table and I am creating the relationship with the table suggested to be created.

      • parry2k's avatar
        parry2k
        Icon for Super User rankSuper User

        Anonymous can you share the relationship diagram and where you are getting this error, bit hard to visualize and understand without seeing it.