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 August 31st. Request your voucher.

Reply
anu2021
Frequent Visitor

Help with Excel formula

I am trying to do a date mapping in the following data basis the the value present fields...  Value > 0 , the first value month will start month and the last value >0 should be the end month.. Sample data i have given... Could you please help

 

Identity1-Jan-251-Feb-251-Mar-251-Apr-251-May-251-Jun-251-Jul-251-Aug-251-Sep-251-Oct-251-Nov-251-Dec-251-Jan-261-Feb-26Start PeriodEnd period
Item10012222200000025-Mar25-Aug
Item20122222000000025-Feb25-Jul
Item30122222000000025-Feb25-Jul
Item40000012222200025-Jun25-Nov
Item50000012222211025-Jun26-Jan

 

1 ACCEPTED SOLUTION
mdaatifraza5556
Super User
Super User

Hi @anu2021 

Can you please try the below steps to get your requirement ?

1. Use below formula to get Start Period

=TEXT(INDEX($B$1:$O$1, MATCH(TRUE, INDEX(B2:O2>0, 0), 0)), "yy-mmm")

2. Use below formula to get End Period
=TEXT(INDEX($B$1:$O$1, MATCH(1, INDEX((B2:O2>0)*(COLUMN(B2:O2)=MAX(IF(B2:O2>0, COLUMN(B2:O2)))), 0), 0)), "yy-mmm")

Screenshot 2025-08-11 152209.png

 



If this answers your questions, kindly accept it as a solution and give kudos.


I have also attached the excel file.

View solution in original post

6 REPLIES 6
mdaatifraza5556
Super User
Super User

Hi @anu2021 

Can you please try the below steps to get your requirement ?

1. Use below formula to get Start Period

=TEXT(INDEX($B$1:$O$1, MATCH(TRUE, INDEX(B2:O2>0, 0), 0)), "yy-mmm")

2. Use below formula to get End Period
=TEXT(INDEX($B$1:$O$1, MATCH(1, INDEX((B2:O2>0)*(COLUMN(B2:O2)=MAX(IF(B2:O2>0, COLUMN(B2:O2)))), 0), 0)), "yy-mmm")

Screenshot 2025-08-11 152209.png

 



If this answers your questions, kindly accept it as a solution and give kudos.


I have also attached the excel file.

This helps and solves the problem for 2 lakh+ records... Thank you 🙂

danextian
Super User
Super User

Hi @anu2021 

 

Please provide a workable sample data (not an image), your expected result from the same sample data and your reasoning behind. The sample data must actually represent your raw data and not simply the desired output. You may post a link to Excel or a sanitized copy of your PBIX stored in the cloud. Also, your image is very hard to read

danextian_0-1754904878915.png

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

hi, I am trying to attach the file.. however i am not finding an option to attach.. so updated it with the table view intead of image..

jaineshp
Memorable Member
Memorable Member

Hey @anu2021,

Could you please attach the excel file instead of image?

Image won't help understand the scenario.

Best regards,
Jainesh Poojara / Power BI Developer

i am unable to attach the file.. so tried pasting it in table view instead of Image.. 😞

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.