Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
JeanRafael
New Member

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.

JeanRafael_0-1724181474287.png

JeanRafael_1-1724181507873.png

 

 

1 ACCEPTED SOLUTION
v-jiewu-msft
Community Support
Community Support

Hi @JeanRafael ,

Based on my testing, please try the following methods:

1.Create the sample table.

vjiewumsft_0-1724203861154.png

vjiewumsft_1-1724203872585.png

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

vjiewumsft_2-1724203879887.png

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.

vjiewumsft_3-1724203888869.png

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.

View solution in original post

4 REPLIES 4
v-jiewu-msft
Community Support
Community Support

Hi @JeanRafael ,

Based on my testing, please try the following methods:

1.Create the sample table.

vjiewumsft_0-1724203861154.png

vjiewumsft_1-1724203872585.png

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

vjiewumsft_2-1724203879887.png

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.

vjiewumsft_3-1724203888869.png

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.

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

Hi @JeanRafael ,

The date column in the calendar table may be problematic and filters should be added.

Try to check the date values and date formats.

Besides, try removing the slicer visual and re-adding the slicer. Adding the date column into the slicer visual.

You can also view the following documents to learn more information.

Create date tables in Power BI Desktop - Power BI | Microsoft Learn

FILTER function (DAX) - DAX | Microsoft Learn

 

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.

ryan_mayu
Super User
Super User

@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?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.