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.
Hello people,
I have the following issue. I have 3 tables that contain finnancial data 'Production', 'InvoicedAmounts' and 'Manual update'. The data they contain is managed by the 'BusinessLine' dimension table to which all of them are linked.
I just need to perform a simple operation substracting one amount from table Production to table Invoced amounts and add the Manual Update, for all rows.
I have been trying to create a calculated column from one of the three tables containing the amounts to no avail.
I wanted to establish a bidirectional filtering between the thress of them and the 'BusinessLine' but since two of them are linked to the calendar, Power BI doesn't like it.
Here is the schema
Thank you for your help.
you can try with TREATAS
https://www.sqlbi.com/articles/propagate-filters-using-treatas-in-dax/
Thank you for your suggestion Stachu, this is the formula I'm trying to apply but it doesn't work:
Amount =
CALCULATE (
SUM ( PRODUCTION[Figures] ),
TREATAS ( { InvoicedAmount[Figures] }, 'Manual update'[Figures] )
)
This is what I want to achieve: PRODUCTION[Figures] - InvoicedAmount[Figures] + 'Manual update'[Figures] = Amount
Thanks for the warning darlove. I'm really starting and I read about ambiguous models. What is your suggestion? My problem is that the three tables 'production' 'invoicedamounts' and 'manual update' contain dates that I need to exploit. Would a single relationship from one of them to the calendar suffice?
"Your model is ambiguous because you've got cross-filtering enabled on one of the relationships (well, at least from what I can see in the pic you pasted). The advice is to use cross-filtering only when strictly needed and enable it in a measure through the USERELATIONSHIP directive to CALCULATE."
That cross-filtering allowed me to get the right amounts for the invoicedamounts table, as this one filters on another table where all the invoices are stored. When I disable the cross-filtering the amounts are wrong.
So, it's strictly needed.
The paradox of my problem is that now, I see all my data and values for all combinations of dimensions BUT I cannot get the right results when trying to do simple arithmetic operations between them.
Cross-filtering can be enabled on demand in a measure. My advice to you is to re-think the model. Otherwise, you might be in deep trouble very soon (if not yet).
By the way, what's the use of the model that is ambiguous and you cannot predict when and whether it calculates a correct number or not? You should really watch/read some material about proper data modeling. Sorry. I can't help you any more than that.
Best
Darek
here is an excellent video on the topic:
https://sqlbits.com/Sessions/Event18/Understanding_relationships_in_Power_BI
the rule of thumb - I would avoid bi-directional relationships
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 |
---|---|
41 | |
21 | |
21 | |
14 | |
13 |
User | Count |
---|---|
42 | |
33 | |
30 | |
18 | |
18 |