Forum Discussion
tobiasmcbride
Helper III
6 years agoNumber at a particular date
Hi, I have the following data on headcount. Name Position Start Date End Date Current Status Joe Bloggsd Head of Marketing 21/02/2017 Established Noah Anyone Head of Opera...
v-easonf-msft
Community Support
6 years agoHi , tobiasmcbride
Follow these steps:
1.Change the type of "Start Date" and "End Date "from "text" to "data" in "Edit queries"
1) replace "" to null in "End Date"
= Table.ReplaceValue(#"Changed Type","","null",Replacer.ReplaceText,{"End Date"})2)change type
= Table.TransformColumnTypes(#"Replaced Value",{{"Start Date", type date}},"ar-BH")= Table.TransformColumnTypes(#"Changed Type1",{{"End Date", type date}},"ar-BH")It will show as below:
2.Create calculate table "Date" and table "Current Status" to create slicer
Date = CALENDAR(MIN('Table'[Start Date]),TODAY())Current Status = SUMMARIZE('Table','Table'[Current Status])
3.create measure "count" in Table and apply it in card visual
Count = CALCULATE(COUNTROWS('Table'),FILTER('Table',IF(ISBLANK([End Date]),'Table'[Start Date]<=[currentdate],'Table'[Start Date]<=[currentdate]&&'Table'[End Date]>=[currentdate])))
4.create measure "visual control" and apply it in the table visual filter
Visual Control = IF([Count]>0,1,-1)
In the end ,it shows as below:
Here is a demo .
Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.