Forum Discussion

bgierwi2's avatar
bgierwi2
Icon for Advocate I rankAdvocate I
1 year ago
Solved

Getting Count of Entries in Current Month

Completed Date
5/16/25
5/2/25
4/15/25
3/14/25
2/1/25
1/20/25
12/10/24

 

This entry is formated as a Date

Would like to get a visual that shows the number of entires in "Completed Date" that are in the current month

For May 2025, the visual would say "2"

If the current month was April 2025, the visual would be "1"

Etc

  • bgierwi2 Create the below measure and let me know if I had resolved your ask

    CurrentMonthCount = 
    CALCULATE(
        COUNTROWS('YourTableName'),
        FILTER(
            'YourTableName',
            YEAR('YourTableName'[Completed Date]) = YEAR(TODAY()) &&
            MONTH('YourTableName'[Completed Date]) = MONTH(TODAY())
        )
    )
    

     

3 Replies

  • bgierwi2 Create the below measure and let me know if I had resolved your ask

    CurrentMonthCount = 
    CALCULATE(
        COUNTROWS('YourTableName'),
        FILTER(
            'YourTableName',
            YEAR('YourTableName'[Completed Date]) = YEAR(TODAY()) &&
            MONTH('YourTableName'[Completed Date]) = MONTH(TODAY())
        )
    )
    

     

  • Hi bgierwi2 

    If I understand correctly, your goal is to show a count of entries for the month the report is being viewed — meaning each month the report is opened or refreshed, it will automatically show the count for the current calendar month.

    If that's the case, you can use a measure like this (and name it something like Current Month Count):

    DAX
    Entries This Month =
    CALCULATE(
    COUNTROWS('YourTable'),
    MONTH('YourTable'[Completed Date]) = MONTH(TODAY()),
    YEAR('YourTable'[Completed Date]) = YEAR(TODAY())
    )
    This will return the number of entries whose Completed Date falls within the current month.

    However, if your goal is not to always show the current month but rather display counts by month (e.g. in a bar or line chart), you should build a proper calendar table with the desired granularity (e.g. year/month), relate it to your transaction table, and use that in your visuals.

    More information about working with the dates table by the link
    👉 Creating a Date Table in Power BI

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

  • Ashish_Excel's avatar
    Ashish_Excel
    Icon for Solution Supplier rankSolution Supplier

    Hi,

    Create a Calendar table with calculated column formulas for Year, Month name and Month number.  Sort the Month name column by the Month number column.  Create a relationship (Many to One and Single) from the Date column of your Fact table to the Date column of the Calendar table.  To your visual, drag Year and Month name from the Calendar table.  Select a Year and Month name.  Write this measure

    Measure = countrows(Data)

    Hope this helps.