Forum Discussion

vivaldii's avatar
vivaldii
New Member
2 years ago
Solved

How can I compare dates selected from two separate slicers?

Hi,

And I need change percentage also number of changes

 

 

  • Hi vivaldii ,

     

    You need a separate dates table that doesn't have relationship to your fact You can create one in DAX by referencing the original Dates table

    Dates2 = Original_Date.

     

    Please see sample pbix for reference.

6 Replies

  • Hi vivaldii ,

     

    You need a separate dates table that doesn't have relationship to your fact You can create one in DAX by referencing the original Dates table

    Dates2 = Original_Date.

     

    Please see sample pbix for reference.

  • You may create 2 different instances of date table and join with your main / fact table. And then put slicer based from those 2 different date tables and also create 2 set of count measures based on 2 date tables.

    If this resolves your problem, then please mark it as Solution, thanks!

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi samratpbi , danextian ,thanks for the quick reply, I'll add more.

    Hi vivaldii ,

    The Table data is shown below:

    Please follow these steps:
    1. Use the following DAX expression to create a table named ‘Table2’

    Table 2 = CALENDAR(DATE(2024,1,1),DATE(2024,12,31))

     2. Use the following DAX expression to create a table named ‘Table3’ 

    Table 3 = CALENDAR(DATE(2024,1,1),DATE(2024,12,31))

    3. Use the following DAX expression to create a measure

    Measure = CALCULATE( SUMX(FILTER('Table','Table'[Date] = SELECTEDVALUE('Table 2'[Date])),[Number]),ALL('Table 3'[Date]))

    4. Use the following DAX expression to create a measure

    Measure 2 = CALCULATE( SUMX(FILTER('Table','Table'[Date] = SELECTEDVALUE('Table 3'[Date])),[Number]),ALL('Table 2'[Date]))

    5. Use the following DAX expression to create a measure

    Measure 3 = [Measure 2] - [Measure]

    6. Use the following DAX expression to create a measure

    Measure 4 = DIVIDE([Measure 3],[Measure 2])

    7. Final output

     

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

    • vivaldii's avatar
      vivaldii
      New Member

      Hi,

      Thanks a lot. I tried but, I don't have data like your "Table" example.
      I need before date to selected. Not only one month period.

       

      <= selected value

       

      Measure = CALCULATE( SUMX(FILTER('İlgili Kişi','İlgili Kişi'[Oluşturma Tarihi] <= SELECTEDVALUE('Başlangıç Tarihi'[Date])),[Gönüllü Sayısı Toplam]),ALL('Bitiş Tarihi'[Date]))

       

       

      but it doesn't work.