Forum Discussion

LowriDragon's avatar
LowriDragon
Frequent Visitor
1 year ago
Solved

Count invoices in day range

Hey peeps,   I am trying to create a measure which will count the number of invoices which have been processed per month. I then want to be able to filter this with a slicer based on the selected ...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi, LowriDragon 

    Thanks for the reply from danextian. Perhaps you can try to create multiple Numeric parameters to achieve your needs.

    Counts = 
    VAR _year = SELECTEDVALUE('Year'[Year])
    VAR _month = SELECTEDVALUE('Month'[Month])
    VAR _startDay = SELECTEDVALUE('Day Range Start'[Day Range Start])
    VAR _endDay = SELECTEDVALUE('Day range end'[Day range end])
    VAR _startDate = DATE(_year,_month,_startDay)
    VAR _endDate = DATE(_year,_month,_endDay)
    VAR _re = CALCULATE(COUNTROWS(Invoices),FILTER(Invoices,Invoices[process ?] = "Yes" && Invoices[date]>=_startDate && Invoices[date]<=_endDate))
    RETURN
    IF(ISBLANK('Year'[Year Value]) || ISBLANK('Month'[Month Value]) || ISBLANK('Day Range Start'[Day Range Start Value]) || ISBLANK('Day Range Start'[Day Range Start Value]),"Error Date Range",_re
    )
    

     

    Best Regards,
    Yang

    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
    If I misunderstand your needs or you still have problems on it, please feel free to let us know.
    Thanks a lot!

    How to get your questions answered quickly --  How to provide sample data in the Power BI Forum