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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
DavidM6051
Regular Visitor

Power-Bi with a data-source (DWH)

I'm new to Power-Bi and just need help creating a new custom columns.
The one I need help with is:
I have a table already containing;
* Name (over 100 names)
* Start date (when they started)
* Activities (2 different activities, that are named already, that need to be completed)

 

What I need is a clustered column chart to show:
Across a timeline, how many people (Name) need to complete Activity 1 in 30 days
Across the same timeline how many people need to complete Activity 2 in 7 months

 

The chart should then show: (for example)
In March there are 3 Activity 1's planned and 10 Activity 2's
In April there are 10 Activity 1's planned and 20 Activity 2's
In May....
In June....
Etc.

 

The Activities will both need a formula for the dates (30 days for Activity 1 and 7 months for Activity 2)

That is where I get lost with creating this one 😞 

 

Really appreciate any help with this.

1 ACCEPTED SOLUTION

Hi @DavidM6051 ,

 

1. Try to add a new custom column in power query:

if [Activity Name] = "2.4 -Session 1" then  Date.AddMonths([Start Date],1) else if [Activity Name] = "9.8 - Final session" then  Date.AddMonths([Start Date],7) else null

Vlianlmsft_0-1646894014747.png

2. Create a disconnected calendar table 

Table 2 = CALENDAR(MIN('Table'[Start Date]),MAX('Table'[End Date]))

3. Create a measure like below:

A = 
CALCULATE(COUNTX(FILTER('Table',[Start Date]<=MAX('Table 2'[Date]) 
&&'Table'[End Date]>MAX('Table 2'[Date])),('Table'[Name])))

Vlianlmsft_1-1646894105763.png

 


Best Regards,
Liang
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
amitchandak
Super User
Super User

@DavidM6051 ,
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks @amitchandak is the sample data okay in a CSV file format?

NameStart DateActivity Name
A29/06/20212.4 -Session 1
A29/06/20219.8 - Final session
29/06/20212.4 -Session 1
29/06/20219.8 - Final session
C29/06/20212.4 -Session 1
C29/06/20219.8 - Final session
D29/06/20212.4 -Session 1
D29/06/20219.8 - Final session
E29/06/20212.4 -Session 1
F29/06/20212.4 -Session 1
G29/06/20212.4 -Session 1
G29/06/20219.8 - Final session
H23/09/20219.8 - Final session
I23/09/20219.8 - Final session
L23/09/20212.4 -Session 1
M23/09/20212.4 -Session 1
J19/10/20212.4 -Session 1
J19/10/20219.8 - Final session
N19/10/20212.4 -Session 1
O19/10/20212.4 -Session 1
P19/10/20212.4 -Session 1
K23/11/20212.4 -Session 1
Test Tester23/11/20212.4 -Session 1
Test Tester23/11/20219.8 - Final session

So as you can see @amitchandak some people have 1 activity (session 1 or final session) and some have both (session 1 and final session).

If session 1 needs to be completed by end of month 1 and the final session needs to be completed by month 7... how do I visualize this in a timeline chart?

 

I'm guessing that I would need a formla in a new column to add the dates?

Hi @DavidM6051 ,

 

1. Try to add a new custom column in power query:

if [Activity Name] = "2.4 -Session 1" then  Date.AddMonths([Start Date],1) else if [Activity Name] = "9.8 - Final session" then  Date.AddMonths([Start Date],7) else null

Vlianlmsft_0-1646894014747.png

2. Create a disconnected calendar table 

Table 2 = CALENDAR(MIN('Table'[Start Date]),MAX('Table'[End Date]))

3. Create a measure like below:

A = 
CALCULATE(COUNTX(FILTER('Table',[Start Date]<=MAX('Table 2'[Date]) 
&&'Table'[End Date]>MAX('Table 2'[Date])),('Table'[Name])))

Vlianlmsft_1-1646894105763.png

 


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

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors