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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Martin-Prague
Helper II
Helper II

DAX, Disaggregate PLAN data - start date, end date

Hello Comunity,

 

I have source data in this structure:

 

 

Campaign ID Start date End date   Plan
888405244 01.01.2016 31.12.2016 726190
888405244 01.01.2017 31.12.2017 890145
873145821 01.01.2016 31.12.2016 726190
873145821 01.01.2017 31.12.2017 890145
873145818 01.01.2016 31.12.2016 726190

 

 

I would like to recalculate (disaggregate) this data on weekly / monthly or even better on daily level.

And still be able to filter on campaing ID.  

 

The best scerario that I can image is achive the behaviour like having this structure:

 

Campaign ID 	Date		Plan
888405244	01.01.2016	1989,561644
888405244	02.01.2016	1989,561644
.....

 

 

Plan should be recalculated by Datesbetween (Start Date and End Date). Plan is not always on the whole year.

 

Is this possible to somehow achieve this with some DAX measure? Or somehow recculated this table in Power Query?

 

Thanks,

Martin

 

 

1 ACCEPTED SOLUTION
Vvelarde
Community Champion
Community Champion

@Martin-Prague

 

 

Hi, Please check this PBIX Here

 

In Query Editor .

 

img.png 

 

Let me know if works

 

Regards

 

Victor




Lima - Peru

View solution in original post

13 REPLIES 13
Martin-Prague
Helper II
Helper II

Thank you so much for your help! I learnt the new trick with the List.

 

Vvelarde
Community Champion
Community Champion

@Martin-Prague

 

 

Hi, Please check this PBIX Here

 

In Query Editor .

 

img.png 

 

Let me know if works

 

Regards

 

Victor




Lima - Peru

Hi @Vvelarde 

 

Thanks for your solution, it works really well. 

 

I would like to add some additional functionality, instead of spreading a task evenly over the days between the start and end i only want to spread it over week days. My second step would only spread it over working days (excluding bank holidays). 

 

I anticiapte the steps to be:

 

Count the week days between end and start and divide task resouces by this

Apply this daily quantity to just the week days

 

Can you give me some pointers on how to achieve this? I do have date tables which include week days or working days however the modifications you are making are in the pre-processing stage. I am not sure how to incorporate them. 

 

Thanks

 

Will

Abduvali
Skilled Sharer
Skilled Sharer

Hi @Martin-Prague,

 

 

Just create new quick measure and select Concatenated List of Values

Capture59.PNG

 

Regards

Abduvali

Hi @Abduvali,

Thank your for your reply, but this is not what I want. My result is not concatenating Plan.
I need to recalculate the data (Plan column) by number of days in period (Between start date and end date). In order to be Able to be plot this plan on daily/weekly... level.

Regards,
Martin

@Martin-Prague to confirm based on your data set, plan for each row will be 365 days, correct?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hello, no the period is sometimes different, unfortunately. Start date and End date needs to be taken into calculation.

Understood, but in the sample you mentioned it will be difference between dates, and your sample data will return 365 days, correct?

 

or you want plan value do be divided by different in number of days.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

In my sample, yes. The difference should be 365. But this needs to be dynamic.

When i have Plan only for 1.1.2017 - 15.1.2015 then it shoud be recalculated by 15 for this campaign. And my dataset has also these shorter periods.

are you expecintg this output

 

1 1/1/2016  365  1111

1/2/2016  365  1111

1/3/2016  365  1111

1/4/2016  365  1111

1/5/2016  365  1111

....

 

 

so basically each campaign is broken down by date, with date difference between start/end date and plan value,c orrect?

 

above is just an example

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Exactly, it could be only DAX measure - and then somehow link it to date dim. Or could be Power query script.

done, here is the link, look at plan table.

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Perfect, thanks A lot. I will check tommorow, i have now only mobile and Mac. Thanks!!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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