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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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