Forum Discussion
VulcanPromance
Helper II
7 years agoCreating a measure for Cost
I have this visualization The cost license measure calculates price*count. However, I need an if statement to be able to calculate cost differently if the quantity type is pr license or tot...
sdjensen
Solution Sage
7 years agoVulcanPromance
Helper II
7 years agoIm very new to Power BI, but the column one kinda makes sense.. I created the column on the table. And for each license it puts on the price obviously.. So Price = CostColumn for each license in the table.
Cost_Licenses =
IF(
Licenses[Quantity_Type] = "Total";
Licenses[Price];
Licenses[Price] * Licenses[Count]
)I reckon it runs this code pr line/record and since a record = 1 count the price = cost
So for each record that has a quantity type of Total it lists 482. When visualizing this column, it multiplies the numbers
EDIT: Yes, I checked that Total does not have any space before or after.
I'm suspecting this has something to do with how I set up the tables? I merged in prices, bundlename and quantity type from another table in power query.