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

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.

amitchandak
Super User
Super User

@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...

 



New Power BI Features
Datamarts: https://youtu.be/8tskWsJTEpg
Field Parameters : https://youtu.be/lqF3Wa1FllE?t=70
Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!
Dashboard of My Blogs !! Connect on Linkedin !! Proud to be a Super User!
Want To Learn Power BI
Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
!! Subscribe to my youtube Channel !!

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
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