Forum Discussion
ChrisNelsonPE
Helper I
5 years agoI'm stumped on analyzing data by date
CREATE TABLE Visits ( Visitor NCHAR(10), VisitedOn DATE, PurposeOfVisit NCHAR(10) ) GO INSERT INTO dbo.Visits (Visitor, VisitedOn, PurposeOfVisit) VALUES (N'Bob ', N'2020-11-23', N'A '); INSE...
- Anonymous5 years ago
Hi ChrisNelsonPE ,
For a bar chart, you try the measures.
Measure = CALCULATE(DISTINCTCOUNT('Table'[Visitor]),FILTER('Table',[VisitedOn]=MAX('Table'[VisitedOn])))Just use FILTER function to filter the dates which you want. MAX corresponds to the latest date, and MIN corresponds to the earliest date.
New sample pbix file is here.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
Super User
5 years agoChrisNelsonPE , Try a measure like
sumX(values(Table[VisitedOn]), calculate(distinctcount(Table[Visitor])))