Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowJuly 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more
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
| Identity | 1-Jan-25 | 1-Feb-25 | 1-Mar-25 | 1-Apr-25 | 1-May-25 | 1-Jun-25 | 1-Jul-25 | 1-Aug-25 | 1-Sep-25 | 1-Oct-25 | 1-Nov-25 | 1-Dec-25 | 1-Jan-26 | 1-Feb-26 | Start Period | End period |
| Item1 | 0 | 0 | 1 | 2 | 2 | 2 | 2 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 25-Mar | 25-Aug |
| Item2 | 0 | 1 | 2 | 2 | 2 | 2 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 25-Feb | 25-Jul |
| Item3 | 0 | 1 | 2 | 2 | 2 | 2 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 25-Feb | 25-Jul |
| Item4 | 0 | 0 | 0 | 0 | 0 | 1 | 2 | 2 | 2 | 2 | 2 | 0 | 0 | 0 | 25-Jun | 25-Nov |
| Item5 | 0 | 0 | 0 | 0 | 0 | 1 | 2 | 2 | 2 | 2 | 2 | 1 | 1 | 0 | 25-Jun | 26-Jan |
Solved! Go to Solution.
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")
I have also attached the excel file.
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")
I have also attached the excel file.
This helps and solves the problem for 2 lakh+ records... Thank you 🙂
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
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..
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.. 😞
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.
| User | Count |
|---|---|
| 27 | |
| 23 | |
| 18 | |
| 18 | |
| 15 |
| User | Count |
|---|---|
| 49 | |
| 44 | |
| 42 | |
| 39 | |
| 32 |