Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi
I have this calculation
Solved! Go to Solution.
I'm assuming this is a measure.
You do have do watch out when adding a constant to a measure, as it means a value is returned for any combination of dimensions that might be included in a visual, potentially impacting performance.
Also, the outer CALCULATE is not needed if this is a measure.
I would try this:
VAR Ratio =
DIVIDE (
SUM ( FT_ManufacturingOrderHeader[Manufactured Quantity KG] ),
SUM ( FT_ManufacturingOrderHeader[Kg Fillets] )
)
RETURN
IF ( NOT ISBLANK ( Ratio ), Ratio - 1 )
Alternatively, you could write this (should be equivalent):
VAR ManQtyKG =
SUM ( FT_ManufacturingOrderHeader[Manufactured Quantity KG] )
VAR KGFillets =
SUM ( FT_ManufacturingOrderHeader[Kg Fillets] )
RETURN
DIVIDE ( ManQtyKG - KGFillets, KGFillets )
Regards,
Owen
Thank you, Owen, it works perfect and quick 😀
User | Count |
---|---|
22 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
25 | |
13 | |
11 | |
9 | |
6 |