The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Cumlative count is displaying great for this year. But how do I go about showing the previous year? You can see in the screenshot above I'm looking to compare 2 years, cumulatively. (This YTD, and last year entirely)
Solved! Go to Solution.
This is your code:
Cum2 = TOTALYTD(CALCULATE(COUNT(IncidentInjury[id]));IncidentInjury[created_at];ALL(IncidentInjury))
Cum3 = TOTALYTD(CALCULATE(COUNT(IncidentInjury[id]));SAMEPERIODLASTYEAR(IncidentInjury[created_at]);ALL(IncidentInjury))
as seen here:
Please mark as solution if so, thumbs up for the effort would be great.
Kind regards, Steve.
Proud to be a Super User!
Awesome Keyboard Shortcusts in Power BI, thumbs up if you like the article
My Community Blog Articles (check them out!)
My Blog - Power M code to automatically detect column types -
How to create test data using DAX!
This is your code:
Cum2 = TOTALYTD(CALCULATE(COUNT(IncidentInjury[id]));IncidentInjury[created_at];ALL(IncidentInjury))
Cum3 = TOTALYTD(CALCULATE(COUNT(IncidentInjury[id]));SAMEPERIODLASTYEAR(IncidentInjury[created_at]);ALL(IncidentInjury))
as seen here:
Please mark as solution if so, thumbs up for the effort would be great.
Kind regards, Steve.
Proud to be a Super User!
Awesome Keyboard Shortcusts in Power BI, thumbs up if you like the article
My Community Blog Articles (check them out!)
My Blog - Power M code to automatically detect column types -
How to create test data using DAX!
Thanks Steve!
What's the filter/syntax to cut the data off at the MAX date? (For example, I want the line to stop at June)
Welcome!
Are you using a date dimension?
Proud to be a Super User!
Awesome Keyboard Shortcusts in Power BI, thumbs up if you like the article
My Community Blog Articles (check them out!)
My Blog - Power M code to automatically detect column types -
How to create test data using DAX!
Yes, using a Date Dimension table. Although PBI might be trying to use the internal as well.
Andy
SAMEPERIODLASTYEAR() gives you the entire previous year's date range. That is somewhat unexpected, but it perfectly fits what you want (however questionable the reasoning behind that is).
User | Count |
---|---|
16 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
26 | |
13 | |
12 | |
9 | |
8 |