cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

Crime Analysis Table

I am trying to do a real time crime analysis table visual based off of a live sql query. I have a data table which has columns that provides the date (date_occurred) the crime took place, the uniform crime report (ucr) number and  the description (UCR_description) for each UCR code.

Date OccurredUCR CodeCode Description
1/1/20110H
1/1/20210S
1/1/20740AU
1/1/20600B
1/1/20600B
1/1/20310R
1/1/20310R
1/1/20310R
1/1/20210S
12/12/19820T
12/12/19820T
12/12/19810T
12/12/19740AU
12/12/19900AR
12/12/19110H
12/12/19210S
12/12/19210S
12/12/19600B
1/17/20600B
1/17/20310R
1/17/20310R
1/17/20310R
1/17/20210S
1/17/20820T
1/17/20820T
1/17/20810T
1/17/20740AU
1/17/20900AR
1/17/20900AR

 

I am trying to do a year to date comparision by each UCR code that would produce a table visual like this:

UCR Description20202019% Change
110H110.00%
210S12-50.00%
310R60600.00%
600B31200.00%
740AU21100.00%
810T110.00%
820T220.00%
900AR21100.00%

 

I can get the table visual to work for YTD 2020 but can not figure out how to show the year to date comparision between 2020 and 2019. The year to date would always compair this year to last year. 

 

Any help would be appreciated.

2 REPLIES 2
Highlighted
Super User IV
Super User IV

Re: Crime Analysis Table

@CliffordHagan there are lots of posts on comparing with Previous Year and the key is to add date/calendar dimension in your model. There are many posts on how you add date/calendar dimension and as it is a best practice to do all Time Intelligence calculations from this date/calendar dimension. This is your starting point and you will easily get it working using time intelligence functions.

 

 

I would 💖 Kudos 🙂 if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

 

 






Did I answer your question? Mark my post as a solution.

Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





Highlighted
Super User IV
Super User IV

Re: Crime Analysis Table

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Galleries

Galleries

Looking for inspiration on how to present your data? Need instructional videos? Check out our Galleries!

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors