Forum Discussion
Count Jobs within Dates Selected
Very confused. What do you want the answe to be? If you want the answer to be 126, then write this measure
Jobs = distinctcount(Data[Job number])
Total = SUMX(VALUES(Calendar[Month name]),[Jobs])
Ensure that you slicers for Year and Month name are from the Calendar Table.
- Matt_Mohawk3 years agoHelper II
Sorry about the confusion. I don't want the total to be 126. I need it to look at my data that runs from 2019 to current data and check to see if the job number has been used before. If so, then it can't be a new job unless that job was started within the given timeframe. For example, if there is a job that was entered in 2020 and I am searching for any new jobs in 2022, the job in 2020 should not show up on the list as a new job.
- Ashish_Mathur3 years agoSuper User
Hi,
Ensure that you have a Calendar Table with calculated column formulas for year, Month name and Month number. Sort the Month name column by the Month number. Create a relationship (Many to One and Single) from the Date column of the Data Table to the Date column of the Calendar Table. to your visual, drag year and Month name from the Calendar Table. Write these measures
Date fo first interaction = calculate(min(Data[Transaction date]),datesbetween(calendar[date],minx(all(calendar),calendar[Date]),max(calendar[date])))
New customers = countrows(filter(values(data[customer code]),[Date fo first interaction]>=min(calendar[date])))
Drag the second measure to a card visual.
Hope this helps.
- Matt_Mohawk3 years agoHelper II
I think I follow what you said. I will give that a try and let you know if it works.