Forum Discussion
Issue With Table Performance
- 3 years ago
Hi again eliasayyy
Thanks for that 🙂
I'm thinking an acceptable solution may just be to only display the [new Price] and [Final Price] measures if Sales is nonempty.The underlying issue is that the measures are based on Item and Price Change tables that are not filtered by Customer, so will return a result for every Customer when Customer Name is included in the visual. We can restrict the combinations of Item/Customer by including only those combinations that occur in Sales, by checking if Sales is nonempty.
new Price = IF ( NOT ISEMPTY ( Sales ), MAX('Price Change'[Accumulated]) * MAX(Items[Item Price]) )Note: Used COALESCE as alternative to IF.
Final Price = IF ( NOT ISEMPTY (Sales ), VAR NewPrice = [new Price] RETURN COALESCE ( NewPrice, MAX ( Items[Item Price] ) ) )Does this or something similar work for you?
Updated PBIX attached.
Regards,
Owen
yes of course heres my pbix file Sales Presentation.pbix
and dataset Sales Report.xlsx
Hi again eliasayyy
Thanks for that 🙂
I'm thinking an acceptable solution may just be to only display the [new Price] and [Final Price] measures if Sales is nonempty.
The underlying issue is that the measures are based on Item and Price Change tables that are not filtered by Customer, so will return a result for every Customer when Customer Name is included in the visual. We can restrict the combinations of Item/Customer by including only those combinations that occur in Sales, by checking if Sales is nonempty.
new Price =
IF (
NOT ISEMPTY ( Sales ),
MAX('Price Change'[Accumulated]) * MAX(Items[Item Price])
)
Note: Used COALESCE as alternative to IF.
Final Price =
IF (
NOT ISEMPTY (Sales ),
VAR NewPrice = [new Price]
RETURN
COALESCE ( NewPrice, MAX ( Items[Item Price] ) )
)
Does this or something similar work for you?
Updated PBIX attached.
Regards,
Owen
- eliasayyy3 years agoMemorable Member
oh i get it now seems to make it faster thank you very much