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

Plot two lines with count of date on a reference axis

Hi,

 

my columns in a table look like this:

 

startend
09.03.2021null
09.03.202115.03.2021
09.03.202115.03.2021
15.03.202115.03.2021
15.03.202119.03.2021
16.03.202123.03.2021

 

the start and end columns have a relationship to a dim_time table in the model. 

 

Now i want to plot the count per date on a referenced time axis. 

 

E.g. for the 15.03.2021 the should be: 2 for count of start and 3 for count of end.

 

How do I achieve this?  

 

 

 

1 ACCEPTED SOLUTION

Hi, @thale 

According to your description, you want to get a plot on a shared time axis, I think you can try to create a line chart like this:

v-robertq-msft_0-1616745536858.png

 

And I guess this can be what you want.

You can download my test pbix file here

 

If this result is not what you want, you can post some sample pictures to show your expected result.

How to Get Your Question Answered Quickly 

 

Best Regards,

Community Support Team _Robert Qin

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-robertq-msft
Community Support
Community Support

Hi, @thale 

According to your description and sample data, I think you can try to create measures to achieve this, you can try my steps:

  1. I created a calendar table for the slicer:
Date = CALENDARAUTO()
  1. Then I create two measures:
count of start =

COUNTX(FILTER(ALL('Table'),[start]=MAX('Date'[Date])),[start])
count of end =

COUNTX(FILTER(ALL('Table'),[end]=MAX('Date'[Date])),[end])
  1. Then create a slicer to place ‘Date’[Date] and two card charts to place the measures:

v-robertq-msft_0-1616641644489.png

 

And you can get what you want.

You can download my test pbix file here

 

If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.

How to Get Your Question Answered Quickly 

 

Best Regards,

Community Support Team _Robert Qin

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Well, that is no help at all. I want a plot on a shared time axis and not a filter with a count.

Hi, @thale 

According to your description, you want to get a plot on a shared time axis, I think you can try to create a line chart like this:

v-robertq-msft_0-1616745536858.png

 

And I guess this can be what you want.

You can download my test pbix file here

 

If this result is not what you want, you can post some sample pictures to show your expected result.

How to Get Your Question Answered Quickly 

 

Best Regards,

Community Support Team _Robert Qin

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

amitchandak
Super User IV
Super User IV

@thale , you need to use userelationship

The assumed start is active

 

Start Count = CALCULATE(COUNTrows(Table]),USERELATIONSHIP(Table[Start Date],'Date'[Date]) )

end count = CALCULATE(COUNTrows(Table]),USERELATIONSHIP(Table[End Date],'Date'[Date]),not(ISBLANK(Table[End Date])))

 

refer

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Thank you. What kind of formular is that? Where should I put this formular? Would appreciate if you start one step earlier. 🙂 

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

Top Solution Authors
Top Kudoed Authors