Forum Discussion
calculate measure by specific column
Hi all,
I have a table "test_runs" of products and their "test results" (the "test results" is a measure)
Each product may have multiple "children" product.
So I have another table "products_relationship" with | "Parent product" | "Child product" | "QTY" | columns.
If a product has childrens, I need to calculate the "tests results" of its childrens products.
So lets say I have product A with 2 sub products a.1 & a.2 - 4 of product a.1 and only 1 of product a.2:
A["test results"] = 0.8*a.1["test results"] + 0.2*a.2["test results"]
My problem is calculating the measure "test results" for child products - at the current state the measure is calculated for the parent product only.
I want to calculate the "test results" measure by specific column "child product".
Any help with this will be much appriciated.
How can I achieve this?
3 Replies
- amitchandak
Super User
Can you share sample data and sample output. If possible please share a sample pbix file after removing sensitive information.
- yanivshe
Helper I
I cant due to work constraints.
Is there a way to calculate a measure on a specific column value? like a function call in a code?
- edhans
Community Champion
We need sample data. Fake data to work with. It is difficult to build a working model based on your description. You have real data. Can you just replicate your model with fake non-sensitive data so we aren't trying to guess how your actual data is structured?
There are ways to calculate measures based on column values, but without seeing the model and table, it is difficult to know if an interator is needed, or CALCLUATE, or the removal of filters, or some combination of any or all of those.