cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Foolke
Helper I
Helper I

count with dates

I have data similar to this:

TicketCreation_DateSolved_Date

14/05/201829/04/2020
28/05/201923/04/2020
317/07/201928/04/2020
428/04/202028/04/2020
520/04/202028/04/2020
625/04/202028/04/2020
722/10/201923/04/2020
825/10/201930/04/2020
927/04/202028/04/2020
1012/11/201929/04/2020

 

I want to calculate for the last 14 calendar days the count of tickets created that date minus the count of tickets solved on that calendar day.

This I want to visualize in a column chart. 

How can I achieve this?

 

Thx !

1 ACCEPTED SOLUTION

Hello @Foolke

you can try to create a new table

New Table = 
ADDCOLUMNS(
CALENDAR(TODAY()-14, TODAY()),
"Count",
CALCULATE(COUNTROWS('Table'),'Table'[Creation_Date]=EARLIER([Date])) - CALCULATE(COUNTROWS('Table'),'Table'[Solved_Date]=EARLIER([Date]))
)

and use it for the visual bar


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

View solution in original post

4 REPLIES 4
az38
Super User
Super User

@Foolke 

what should be on X-Axis this chart?

give an example of desired result please


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

@Foolke you need to add date dimension in your model and that is the first step, have a relationship with your date dimension to these two dates, one will be active relationship and others will be inactive relationship coz there can be only one active relationship between two tables. There are many posts on how to add date dimension in your model.

 

Create measures using COUNTROWS function and the one which has inactive relationship use USERELATIONSHIP function which make an inactive relationship to active.

 

Now you can view the data by date from date dimension using measures.

 

I hope it helps.

 

 






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.





gr.png

Should look something like this:

X-axis: last 14 calendar days (start counting today)

Y-axis: (count of created tickets for date on X axis) minus (count of solved tickets on date on X-axis)

Hello @Foolke

you can try to create a new table

New Table = 
ADDCOLUMNS(
CALENDAR(TODAY()-14, TODAY()),
"Count",
CALCULATE(COUNTROWS('Table'),'Table'[Creation_Date]=EARLIER([Date])) - CALCULATE(COUNTROWS('Table'),'Table'[Solved_Date]=EARLIER([Date]))
)

and use it for the visual bar


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Helpful resources

Announcements
June 2022 update 768X460.jpg

Check it out!

Click here to read more about the June 2022 updates!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power BI Dev Camp Session 23 768x460.jpg

Check it Out!

Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!

June 20 episode 7 with aka link 768x460.jpg

The Power BI Community Show

Join us on June 20 at 11 am PDT when Kim Manis shares the latest on Azure Synapse analytics, the Microsoft Intelligent Data Platform, and notable Power BI Updates from Microsoft Build 2022.

Top Solution Authors
Top Kudoed Authors