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.
We are looking to add a percentage calculation column to work out row by row (given any filter applied) the appropriate calculation based on 2 other columns in a created table visualisation on a report.
However, the columns which are being pulled into the report table are not directly related in the model, they are related by a third table.
Essentially, data table 1 has order information on items, data table 2 has return information on items, the third data table relating them is item to prevent a many to many relationship.
We want to be able to calculate, in a given timeframe (date is a column on the order data table and the return data table), what has been the percentage of returns.
The end user needs to be able to filter on extra information such as return reason (return data table) and picker (order data table) depending on whatever date range they choose on the slider.
Can anyone help on how we can achieve this?
Solved! Go to Solution.
Hi @clarer ,
I have create simple sample. Please refer to it to see if it helps you.
The relationship between these three tables is shown in the following picture.
Then Create a measure.
Measure =
VAR return_number =
CALCULATE (
SUM ( remove[Returns] ),
FILTER ( ALL ( remove ), remove[date] = SELECTEDVALUE ( 'order'[date] ) )
)
VAR percent_ =
DIVIDE ( return_number, SELECTEDVALUE ( 'order'[sales] ) )
RETURN
percent_
If I have misunderstood your meaning, please provide your pbix without privacy information and desired output.
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @clarer ,
Does that make sense? If so, kindly mark my answer as the solution to close the case please. Thanks in advance.
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @clarer ,
I have create simple sample. Please refer to it to see if it helps you.
The relationship between these three tables is shown in the following picture.
Then Create a measure.
Measure =
VAR return_number =
CALCULATE (
SUM ( remove[Returns] ),
FILTER ( ALL ( remove ), remove[date] = SELECTEDVALUE ( 'order'[date] ) )
)
VAR percent_ =
DIVIDE ( return_number, SELECTEDVALUE ( 'order'[sales] ) )
RETURN
percent_
If I have misunderstood your meaning, please provide your pbix without privacy information and desired output.
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Please provide sanitized sample data that fully covers your issue. Paste the data into a table in your post or use one of the file services. Please show the expected outcome.
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 |
---|---|
115 | |
100 | |
88 | |
69 | |
61 |
User | Count |
---|---|
151 | |
120 | |
103 | |
87 | |
68 |