Forum Discussion

Chamari's avatar
Chamari
New Member
11 months ago
Solved

Creating column in date table that counts rows per month if they meet a criteria

Hi all,   I have a date table and would like a count per month of rows from another table if they contain "Y".   The date table looks something like this: Date Table Date YearMonthNumber ...
  • grazitti_sapna's avatar
    11 months ago

    Hi Chamari,

     

    Issue is with the DAX you are using, use below DAX to create new calculated column in date table 

     

    RaisedbyResCount =
    CALCULATE(
    COUNTROWS(RELBs),
    RELBs[RaisedbyRes] = "Y",
    RELBs[YearMonthNumber] = DateTable[YearMonthNumber]
    )

     

    Or you can use below measure if there's relationship between your date table and RELBs

     

    RaisedbyResCount =
    CALCULATE(
    COUNTROWS(RELBs),
    RELBs[RaisedbyRes] = "Y"
    )

     

    ๐ŸŒŸ I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.
    ๐Ÿ’ก Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.
    ๐ŸŽ– As a proud SuperUser and Microsoft Partner, weโ€™re here to empower your data journey and the Power BI Community at large.
    ๐Ÿ”— Curious to explore more? [Discover here].
    Letโ€™s keep building smarter solutions together!