Forum Discussion
aamulhim
3 years agoNew Member
Count Months that contain Values
I need to count the months that contain values to calculate the average spending. The attached photo shows the months that contain values. The target is to get the average spending like this ...
- 3 years ago
Hi aamulhim
Try these:
with a separate dates table
= CALCULATE ( DISTINCTCOUNT ( dates[month] ), FILTER ( 'table', NOT ( ISBLANK ( 'table'[value] ) ) ) )no dates table
= CALCULATE ( DISTINCTCOUNT ( 'dates'[month] ), FILTER ( 'table', NOT ( ISBLANK ( 'table'[value] ) ) ) )if none works, please share a sample data (not an image) and your expected result.
danextian
Super User
3 years agoHi aamulhim
Try these:
with a separate dates table
=
CALCULATE (
DISTINCTCOUNT ( dates[month] ),
FILTER ( 'table', NOT ( ISBLANK ( 'table'[value] ) ) )
)
no dates table
=
CALCULATE (
DISTINCTCOUNT ( 'dates'[month] ),
FILTER ( 'table', NOT ( ISBLANK ( 'table'[value] ) ) )
)
if none works, please share a sample data (not an image) and your expected result.
aamulhim
3 years agoNew Member
Thank you so much Dane. It works.
Best regards,