Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
Hello Community.
I hope you will understand my need. English is not my native language and even in France, it's difficult to explain what i would like to do in PowerBI.
So, let's start by the beginning. I'm an IT guy in charge of AZURE service in my company.
We have deployed an application that is used my many service. We would like to charge back each service to what they consume in Azure.
To do this, we put on all ressource group a tag which contain the service.
We have the following table :
Service | Cost |
IT/System | 100 |
IT/Network | 200 |
IT/DB | 300 |
IT All | 400 |
"IT All" is a cost supported by all teams. I would like to split this cost to all service in proportion of there consommation.
So, for example, IT/DB should pay 50% of the 400 of IT All
How i could do this using PowerBI ?
The cost is calculated each day
Any idea, help would be appreciated. I know how to do in Excel, but in DAX, i'm totally noob
Thanks 🙂
Solved! Go to Solution.
There are several ways to achieve this, Assuming 400 is the cost for all Segments....
Type the DAX formula :
Percent =
FORMAT(DIVIDE('Table'[Cost], MAX('Table'[Cost])), "##0 %")
The values should show up formatted correctly as in the pictures:
Prorated =
var ITCost = LOOKUPVALUE('Table'[Cost], 'Table'[Service], "IT ALL")
var TotCost = SUM('Table'[Cost]) - ITCost
RETURN
IF ('Table'[Service] <> "IT ALL",
FORMAT( DIVIDE('Table'[Cost], TotCost) , "##0 %"),
BLANK()
)
Weighted Cost =
var ITCost = LOOKUPVALUE('Table'[Cost], 'Table'[Service], "IT ALL")
var TotCost = SUM('Table'[Cost]) - ITCost
RETURN
IF ('Table'[Service] <> "IT ALL",
DIVIDE('Table'[Cost], TotCost) * ITCost,
'Table'[Cost]
)
So if I'm reading this right, you want System, Network and DB to be allocated one sixth, one third and half of the All costs respectively? Try this measure:
So if I'm reading this right, you want System, Network and DB to be allocated one sixth, one third and half of the All costs respectively? Try this measure:
Thanks you too Jthomson for your help.
I will try this too and tell you if i successed
🙂
Thanks guys for your help.
Both solutions works for me 🙂
There are several ways to achieve this, Assuming 400 is the cost for all Segments....
Type the DAX formula :
Percent =
FORMAT(DIVIDE('Table'[Cost], MAX('Table'[Cost])), "##0 %")
The values should show up formatted correctly as in the pictures:
Prorated =
var ITCost = LOOKUPVALUE('Table'[Cost], 'Table'[Service], "IT ALL")
var TotCost = SUM('Table'[Cost]) - ITCost
RETURN
IF ('Table'[Service] <> "IT ALL",
FORMAT( DIVIDE('Table'[Cost], TotCost) , "##0 %"),
BLANK()
)
Weighted Cost =
var ITCost = LOOKUPVALUE('Table'[Cost], 'Table'[Service], "IT ALL")
var TotCost = SUM('Table'[Cost]) - ITCost
RETURN
IF ('Table'[Service] <> "IT ALL",
DIVIDE('Table'[Cost], TotCost) * ITCost,
'Table'[Cost]
)
Hi Andres,
Thanks for you mini tutorial. I'm gonna try this right now !!!
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
113 | |
91 | |
84 | |
76 | |
65 |
User | Count |
---|---|
145 | |
109 | |
109 | |
102 | |
96 |