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
Mederic
Helper V
Helper V

Create a depreciation analysis table

Hello,

This topic is a continuation of my 1st post here,
Thanks to the contributors, I realised that it wasn't possible to create a custom table directly in Power Pivot Excel, at least not in the way I thought.
So I created a calendar table in Power Query and loaded it into Power Pivot.

The M code for the calendar table isn't great, but it works

Now I'd like to continue to the end.
If I understand correctly, I need to create 2 measures to obtain the final result.
And I'm already getting stuck

Can you please help me to create these 2 measurements ?

 

Thanks in advance

Best regards

 depreciation_6.jpgdepreciation_7.jpg

 

 

let
    Source = {Number.From(#date(2020,1,1))..Number.From(#date(2022,12,31))},
    #"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    #"Changed Type" = Table.TransformColumnTypes(#"Converted to Table",{{"Column1", type date}}),
    #"Renamed Columns" = Table.RenameColumns(#"Changed Type",{{"Column1", "Date"}}),
    #"Added Custom Column" = Table.AddColumn(#"Renamed Columns", "Custom", each Text.Combine({Date.ToText([Date], "yyyy"), "0", Date.ToText([Date], "%M")}), type text),
    #"Renamed Columns1" = Table.RenameColumns(#"Added Custom Column",{{"Custom", "YM"}})
in
    #"Renamed Columns1"

 

 depreciation_8.jpg

2 REPLIES 2
Mederic
Helper V
Helper V

Hello @v-zhengdxu-msft ,

Sorry for the late reply, and thank you for your message.
In fact there was the whole description in the link in my 1st message. You're right, here's a Power Bi file with 2 tables and an image of what I'd like to reproduce. It's a statement that I found in this link.
I'm having trouble creating the Measures

Power BI File 

Thanks in advance

Best regards

depreciation_9.jpg

v-zhengdxu-msft
Community Support
Community Support

Hi @Mederic 

 

What the result you want to get?

Please describe the issue you met in detailed, so that we can help you better.

And could you please provide the sample data(without sensitive data), or create some sample data.

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.

Top Solution Authors