Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
In this simplified example I am selling item A and B.
I have a fact table with sales and discount amounts.
Sales and discounts have different granularity. One sale can have several discount types. In this example types X, Y and Z.
It is all merged in to one table.
So I need to calculate salesamount for each unique SalesId to get the correct amount.
I solved it like this:
MaxSales = MAX(Tabell1[Amount]) SalesAmount = SUMX(VALUES(Tabell1[SalesId]);[MaxSales])
SalesAmount over DiscountType and Item is calculated as I want it to.
However, it is quite slow!
I am doing this in SSAS Tabular with a fact table with 500 million rows. Is there any way to do this more efficiently?
I tried splitting discounts and sales into two separate fact tables with a relation between but it worked horrible.
Help is much appreciated!
Hi @Anonymous,
Does that make sense? If so, kindly mark my answer as the solution to close the case please. Thanks in advance.
Regards,
Frank
Hi Frank
Nah, there are no useless rows to clean.
I tried the FIRSTNONBLANK function instead of MAX in hope of better performance but it was slightly slower to my surprise.
Hi @Anonymous,
The measures could perform well in your scenario. As the formula is simple enough.To imporve the performance, we should optimizate the data from the data source. For example to reduce useless rows.
Regards,
Frank