Forum Discussion
Count invoices in day range
- Anonymous1 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 TeamIf 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
I want to be able to count the number of invoices processed per month, within the first 10 days, or the first 15 days. This is for comparison purposes.
- danextian1 year ago
Super User
This is just a sample measures based on the data provided:
15 days = CALCULATE ( [invoice count], FILTER ( VALUES ( dates[date] ), DAY ( dates[date] ) <= 15 ) )If this isn't what you're looking for, please provide a workable sample data (not an image), your expected result from the same sample data and your reasoning behind. https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523
- LowriDragon1 year agoFrequent Visitor
I am looking for this to be dynamic with a slicer for selecting the day range. The day range is based on the day numbers in the date table.
- danextian1 year ago
Super User
Going back to this:
Please provide a workable sample data (not an image), your expected result from the same sample data and your reasoning behind.