LongCut logo

DB vs DDB vs DISC in Power BI DAX | Depreciation & Discount Functions Explained

By NextGen Data Aspirants Community

Summary

Topics Covered

  • DB Depreciates Assets via Fixed Declining Balance
  • DDB Accelerates Depreciation Doubling Decline Rate
  • DISK Computes Security Discount Rates
  • DAX Financials Mirror Excel Precision

Full Transcript

[music] Hello [snorts] everyone, welcome to NextGen data aspirants community YouTube channel. This is Babu.

channel. This is Babu.

Today in this video I'm going to explain you about few financial DAX functions and we are running a financial DAX

functions YouTube video series. So far

we completed uh till this scoop and CD and as well as this this cumulative principle. So today

in this video I am going to explain you about DB

DDB and disks. So before

exploring and creating the DAX measure let's understand this what is this DAX functions. Now [snorts]

functions. Now [snorts] let me jump into Microsoft official documentation. So here if you see DB see

documentation. So here if you see DB see this is a DB. So it returns the depreciation of an asset for a specific

period using [snorts] fixed declining balance method. So it means that it will

balance method. So it means that it will return a depreciation value of your asset for the specific period uh using the fixed declining balance method. Now

here if you see the syntax is cost it is the initial cost and this is salvage value. This is life value and period and

value. This is life value and period and month. Now let's see what is this

month. Now let's see what is this syntax. So here if you see the cost is

syntax. So here if you see the cost is as mentioned by this is initial cost and salvage value it means the this is some depreciation value of the asset and life

here if you come to the what is the depreciated lifetime and period period must be units of life or in between the one and life. So we need to give in

between the one and life and month is a optional num month. This is the number of months in the first year. the number

of months in the first year. If we

didn't provide anything by default it will take the 12 months. So uh now let's go and see what is DDB. So here if you

see DDB so it returns the depreciation of an asset for a specific period using the double declining balance method. So it will

return the depreciation of asset for the specific period using the double decline balance method. So the DDB stands for

balance method. So the DDB stands for double decline balance method. The

syntax is the same cost salvage life period and one thing is this is different factor. Let's see what is this

different factor. Let's see what is this factor. Factor is after one word the

factor. Factor is after one word the rate at which the balance declines. If

the factor is omitted it assumes to be to the double decline balancing method.

The double decline balancing method.

Fine. Now, so here what we will do? So we will calculate uh now let's understand disk. So here if

you see the disk value.

So disk is nothing but it returns the discount rate for a security. So

settlement date, maturity date, price for 100 uh dollar face value, redemption for 100 uh redemption value for 100 face value. Now the next one is biases.

value. Now the next one is biases.

Settlement is uh nothing but settlement date. Maturity is nothing but maturity

date. Maturity is nothing but maturity date and uh price is uh PR is price for 100 face value. Redemption is redemption for 100 face value. Buy CC is nothing

but uh uh the month. So if we use zero it will be 360 and if you use one actual by actual if you use two actual by 360.

So this is all theoretical part. Now

let's uh head over to PowerBI desktop and let's start practicals.

Now before going into the measures creation now let's understand the data set. Here if you see there is a data set

set. Here if you see there is a data set called I mean table asset table. So in

this you will have a asset ID. So let's

say laptop server printer these are the assets. Okay. This is the initial cost

assets. Okay. This is the initial cost and this is the salvage value lifetime years and months and this is the period.

Okay. Now let's go to the report view.

Let me take a new measure.

So now here let me write DB. So in this uh we have multiple values. Let me go with variable mechanism.

Let me go with variable mechanism. Now

the first value is cost I mean initial cost equal to selected value of asset table initial

cost. Now shift enter. Now the next

cost. Now shift enter. Now the next variable is [snorts] salvage value selected value of salvage value from the asset table. Here

I have multiple tables but make sure you can select uh uh salvage value. Now the

next thing is life life value. So

selected value of life asset value lifetime in years. So

life in years let me put y for easy differentiating.

Let make it uniform. Now let me come to another line. Now now the next thing is

another line. Now now the next thing is period.

period selected value of period asset table period in month. Now

the last one is month month selected value of

months as a table months. Now let's

return our measure. So in this let's take DB declining balance. Now let's call all

declining balance. Now let's call all the variables. That's all. Now you can

the variables. That's all. Now you can call all the variables cost, salvage, comma, life in years, comma. The next

thing is period. Fine. The last thing is month.

period. Fine. The last thing is month.

The last thing is month. Now let's uh before executing let me DB stands for let me copy the uh declining balance.

Let me copy the declining balance. Let

me put it here. So if anyone see they will understand what is DB. So now let's execute this.

Well, perfect. It executed successfully.

Perfect. Now here I have a table. So in

this what I'll do? Asset ID. Let me make it to don't summarize. So asset ID,

asset name, asset initial cost, salvage value, lifetime years, period, month, and at the last let me drag DB.

That's all. Let me drag DB H. Now we got some values. Now we got some values. So

some values. Now we got some values. So

how would you know that these values are correct? Let me show something to you

correct? Let me show something to you here. If you see in this

here. If you see in this they mentioned one line these functions are similar to financial functions used

in especially Excel used in Excel. Now

let's head over to Excel.

Here the same asset table we do have.

Here the same asset table we do have. So

now let's take DB is equal DB bracket. So the moment if I open bracket see here if you see cost

the syntax it is showing Excel also syntax is showing. So it it is very helpful for us. Now let's take cost comma next salvage value comma life

comma period comma month. Let's close the bracket. Hit enter. Now let me copy and

bracket. Hit enter. Now let me copy and paste. Now we got some values. Now we

paste. Now we got some values. Now we

got some values.

Let's see whether this value is correct or not. Let's see whether this value is

or not. Let's see whether this value is correct or not. First let me go to the page seven.

Now let's open.

Let me take my marker. So laptop 21525 21525 matching server 72576 72576 printer 21348

21348 office furniture 21960 21960 Network switch 1312 13 612 Desktop 4480

444 480 Now the values are exactly matching values are exactly matching fine Now what is our next DAX function?

DDB double declining balance. Double

declining balance. Now in the interest of time saving, let me copy this measure. Let me take a new

measure. Let me take a new [clears throat] measure from the top ribbon bar. Let me rename it to DDB.

ribbon bar. Let me rename it to DDB.

Double declining balance. Let me put the same small letter double declining balance H. But uh in the interest of

balance H. But uh in the interest of time saving I did copy paste but while you are practicing I highly recommend you please write the DAX function from

the scratch.

I hope you all are clear. Now let's take DDB H. So in this the first one is cost.

DDB H. So in this the first one is cost.

Okay already we have cost. Fine. Next

salvage. Fine. Now the next thing is life. Life also we have period.

life. Life also we have period.

Period also we have the P A R I O D.

Period. And the next thing is factor.

This is the the one which is in the square brackets which is optional. Okay.

So we don't have that value. Let me

close the bracket. And meanwhile let me delete this. Now also I would like to

delete this. Now also I would like to tell you one thing here from this DDB uh this is like okay okay that is in that

will come in uh disk DAX function fine now let's execute this perfect it is executed successfully now

let's drag the same DDB DAX function here now we got some values so we don't know if it is calculating internally correct

or not. How we can cross verify that?

or not. How we can cross verify that?

Yes, we can go to our Excel. So here,

let me make it big. Let's take DB here.

Let's call DDB function. Let's open the bracket now. cost okay comma salvage

bracket now. cost okay comma salvage comma lifetime comma period comma the factor is which is optional

one now let me close the bracket now let me do copy and paste here okay so let me put some color for this

so now let's verify let me take my marker H so 40,000 for laptop matching server Server 72886

[snorts] matching printer 15,000 exactly matching office furniture 20480 exactly matching network switch 50,000 and

desktop 53b3 exactly matching if you see the values are exactly matching the values are exactly matching fine

I hope you all are clear the now our last DAX function is disk what is our last DAX function It's a dis it will return the discount rate for your

security. Okay. So now for this I have

security. Okay. So now for this I have another data set. Let me tell you what is that data set. So I have another data set called security table. Usually if

you have uh if you take any security so you will uh they will assign one number.

This is security number. This is

settlement date. This is maturity date.

Price uh face value $100. Face value.

redemption $100 face value biases. These

are the values we have. Fine. Now let's

go to the report view. Fine. Let's take

new measure.

Let's take this is disk. I think let me name it disk.

I will go with variable concept. The

first thing is settlement date.

I will put STM date.

So selected value of sec from the security table you can take the settlement date. Shift enter. Now

the next thing is maturity date.

Selected uh value of maturity date from the security table.

Don't confuse because here I have lot of tables but if you are practicing you will have only one table. Now the next thing is price for $100 face value.

Okay.

Selected value of price.

Now redemption. Redemption.

Selected value of [snorts] redemption.

Now the last one but not least biases.

selected value of prices from the security. Make sure that you can check all the things which is you called from the security table. All

right. Now let's return it.

Return let's take disk. So here just you need to call this uh variables.

Settlement date fine.

Maturity date fine.

Price fine.

Redemption fine biases. Okay. Now let me go here. This

biases. Okay. Now let me go here. This

is discount rate.

discount rate. Let me put it here in comments also. I would like to make one

comments also. I would like to make one comment. This is

comment. This is $100 face value.

Which one? This one.

Sorry. Okay. Fine. Now, let's execute.

All right. It's executed successfully.

Now let me take a copy of this table.

Let me remove all the values quickly from this table. Okay.

Now let's drag security number settlement date maturity date price redemption

biases and the last thing is disk let's change this to uncheck this select settlement data don't put hierarchy

now let's remove this sum of price this sum of redemption also

sum of bices it doesn't make any sense but if you see the value is zero something is there so why the values let's select this measure let's check

the data type data type is general let's convert it to percentage why percentage it will return a discount rate means is you need to convert it to percentage.

Perfect. Now you can see we got the discount rate of each security number.

Fine. Now let's head over to Excel. So

the same security table here. Don't

confuse the same security table here. So

now let's take disk disk um in this settlement date. Okay.

Maturity date price.

then redemption then biases.

Let me copy and paste it here. Now let's

verify 0.08.2.2 0.08.2.2 then 4 and 54.474.47

see the values are matching exactly.

This is all about disk DAX function. Now

let's recap what we learned uh today. So

today we learned DB which is uh declining balance DDB double declining balance and dis discount rate for a security.

I hope you all like this video. Please

like, share, comment this video. Please

subscribe NextG data aspirants community YouTube channel. Thank you all for

YouTube channel. Thank you all for watching video. We'll catch you in

watching video. We'll catch you in another interesting video. Thank you

all. [music]

>> [music]

Loading...

Loading video analysis...