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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anithalakshmi
Frequent Visitor

Break months between dates as Columns

The data I have is

 

 

EmpIDNameProjectStart DateEnd DateEffort%
1Name1P101-02-201829-05-2018100
2Name5P201-01-201801-04-201860
3Name2P301-04-201801-05-201870
4Name2P401-01-201803-04-201830
5Name5P503-01-201804-08-201840

PowerBI dashboard.

I Need the output breakup into Months, with conditional formatting in color code based on effort %.

 

EmpIDNameProjectStart DateEnd DateEffort%JanFebMarAprMayJunJulTill Dec
1Name1P101-02-201829-05-2018100 100100100100   
2Name5P201-01-201801-04-20186060606060    
3Name2P301-04-201801-05-201870   7070   
4Name2P401-01-201803-04-20183030303030    
5Name5P503-01-201804-08-20184040404040404040 

 

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

Not sure if you want to do this in M or DAX. In DAX you can create calculated columns with the following formula:

 

Jan = VAR MyMonth = 1
RETURN IF(MONTH([Start Date])<=MyMonth && MONTH([End Date])>=MyMonth,[Effort%],BLANK())

Just change the column name and the MyMonth value for each column.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

Not sure if you want to do this in M or DAX. In DAX you can create calculated columns with the following formula:

 

Jan = VAR MyMonth = 1
RETURN IF(MONTH([Start Date])<=MyMonth && MONTH([End Date])>=MyMonth,[Effort%],BLANK())

Just change the column name and the MyMonth value for each column.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

my startdate is in Dec 2017 and enddate is in Mar2018

The date comparision fails for dec where the month is 12.Should I use datediff function? Not sure how

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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
Top Kudoed Authors