Forum Discussion

JeanRafael's avatar
JeanRafael
New Member
2 years ago
Solved

About Calendar

Hello, so, i am working with this calendar table, the relationship is 1:*, when i try to use this date slicer, it doenst filter anything, and if i try to use, to see how many gym members canceled their membership,

Soma Matriculas Canceladas = CALCULATE(DISTINCTCOUNT('bd canceledmembership'[idMember]),FILTER('bd canceledmembership','bd canceledmembership'[cancelDate])) or 
Soma Matriculas Canceladas = CALCULATE(DISTINCTCOUNT('bd canceledmembership'[idMember]),FILTER(Calendario,Calendario[Date])), it doesnt matter, of course is a simple problem but i dont know what is wrong, the columns that are conected are both short date, they are cancelDate and Date.

 

 

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi JeanRafael ,

    Based on my testing, please try the following methods:

    1.Create the sample table.

    2.Drag the calendar date column into the slicer visual.

    3.Create the measure to calculate the cancel membership.

    Soma Matriculas Canceladas = 
    CALCULATE(DISTINCTCOUNT('bd canceledmembership'[idMember]),
                FILTER('bd canceledmembership',
                    'bd canceledmembership'[cancelDate] > MIN('Calendar'[Date]) && 'bd canceledmembership'[CancelDate] <= MAX('Calendar'[Date])
                )
            )

    4.Drag the measure into the card visual.

    5.Select the date range in the slicer visual. The result is shown below.

    Best Regards,

    Wisdom Wu

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

4 Replies

  • JeanRafael 

     

    you didnot put any conditions in the filter function.

     

    You can try below DAX.

     

    DISTINCTCOUNT('bd canceledmembership'[idMember])

     

    if this does not work , could you pls provide some sample data and expected output?

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi JeanRafael ,

    Based on my testing, please try the following methods:

    1.Create the sample table.

    2.Drag the calendar date column into the slicer visual.

    3.Create the measure to calculate the cancel membership.

    Soma Matriculas Canceladas = 
    CALCULATE(DISTINCTCOUNT('bd canceledmembership'[idMember]),
                FILTER('bd canceledmembership',
                    'bd canceledmembership'[cancelDate] > MIN('Calendar'[Date]) && 'bd canceledmembership'[CancelDate] <= MAX('Calendar'[Date])
                )
            )

    4.Drag the measure into the card visual.

    5.Select the date range in the slicer visual. The result is shown below.

    Best Regards,

    Wisdom Wu

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

    • JeanRafael's avatar
      JeanRafael
      New Member

      Hello, good morning, it really worked, but i dont understand why my dax is wrong, could you explain it to me please?