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.
Hey,
I'm having a table of Azure Cost Management which contains a lot of Cost data and I would like to introduce a Column called Business Service. Currently I made a new Column for every Business service and defined the input for the Values like the following:
ServiceA_Allocation =
IF (
CONTAINSSTRINGEXACT('Usage details'[JsonTags.area], "dl-big-data")
|| CONTAINSSTRING('Usage details'[ReservationName],"Big-Data" )
|| CONTAINSSTRING('Usage details'[ReservationName],"ADX" ),
1,
0
)
As this get's to complex with more and more Business Services I would like to combine them into just one Column by having one big IF/Else statement. The other statements look very similar to the example of ServiceA. Would that be the best way to do it or is there a better way? Firstly I thought about having some kind of CSV file where I define all my business services which such a logic, updating it from time to time if it's needed any PowerBI will handle it after update is done.
Maybe worth to mention, the table contains around 21 million cells, so it's quite a lot of data and calculation could take time, so maybe there is also a faster way than do it like this.
Thanks in advance!
Solved! Go to Solution.
Got it in the first step running with this one:
Business Service =
SWITCH(
TRUE(),
CONTAINSSTRINGEXACT('Usage details'[JsonTags.area], "dl-big-data")=TRUE(), "Data Engineering",
CONTAINSSTRING('Usage details'[ReservationName], "Big-Data")=TRUE(), "Data Engineering",
CONTAINSSTRING('Usage details'[ReservationName], "ADX")=TRUE(), "Data Engineering",
"Unallocated"
)
Hello Lkshck,
Maybe ‘SWITCH’ can help you? Implemented would be as follows:
SWICTH(
TRUE,
CONTAINSSTRINGEXACT('Usage details'[JsonTags.area] = "dl-big-data", 1,
CONTAINSSTRING('Usage details'[ReservationName] = "Big-Data", 1,
CONTAINSSTRING('Usage details'[ReservationName] = "ADX",1,
0
)
Looks like this doesn't work.
Got it in the first step running with this one:
Business Service =
SWITCH(
TRUE(),
CONTAINSSTRINGEXACT('Usage details'[JsonTags.area], "dl-big-data")=TRUE(), "Data Engineering",
CONTAINSSTRING('Usage details'[ReservationName], "Big-Data")=TRUE(), "Data Engineering",
CONTAINSSTRING('Usage details'[ReservationName], "ADX")=TRUE(), "Data Engineering",
"Unallocated"
)
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
98 | |
96 | |
75 | |
71 | |
64 |
User | Count |
---|---|
143 | |
109 | |
103 | |
82 | |
74 |