Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

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, @Anonymous 

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, @Anonymous 

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.

Anonymous
Not applicable

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

Hi, @Anonymous 

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

@Anonymous , 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-trend/ba-p/882970

 

Anonymous
Not applicable

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.