Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
Trying to understand the following behavior.
Say I have 2 events and on average each event lasts at least 2 months.
Event ID | Start Date | End Date |
1 | 1/1/2020 | 3/1/2020 |
2 | 4/1/2020 | 6/1/2020 |
When I create a very simple chart and display the total events per month (event id distinct count), the same event appears in 3 different months and gives the illusion that I have more events than there actually are.
I have a calendar linked to start date.
How can I only display the event in the month it started?
Solved! Go to Solution.
Hi @WorkHard ,
You can try to create a measure to distinctcount the event id:
Measure = var min_date = CALCULATE(MIN(Event[Start Date]),ALLEXCEPT(Event,Event[Event ID]))
var distinct_ = CALCULATE(DISTINCTCOUNT(Event[Event ID]),FILTER(Event,Event[Start Date]=min_date))
return SUMX(VALUES(Event[Event ID]),distinct_)
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
The behavior you are looking for is the default behavior if there is a relationship between the Date table and the Start Date column. Please make sure:
1. That relationship is active
2. The columns on both sides of the relationship are the same data type (Date not DateTime for example)
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Thanks, Pat.
1. Yes, the relationship between the Start Date and the date in the calendar table is active.
2. Yes, both columns are the same data type (both are date/time).
What else could it be?
To clarify, the Grand Total is displayed correctly as 2 events but the breakdown by month still shows 6 (1 event for each month).
Hi @WorkHard ,
You can try to create a measure to distinctcount the event id:
Measure = var min_date = CALCULATE(MIN(Event[Start Date]),ALLEXCEPT(Event,Event[Event ID]))
var distinct_ = CALCULATE(DISTINCTCOUNT(Event[Event ID]),FILTER(Event,Event[Start Date]=min_date))
return SUMX(VALUES(Event[Event ID]),distinct_)
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
126 | |
111 | |
73 | |
64 | |
46 |