I need to compute Average price as % of Inside cabin total.
i.e. calculate Average price of Inside cabin (all cabins under inside category),
and use this value as Denominator for calculating percentage pr cabin code.
To achieve the results based on the condition that you’ve specified i.e., divide individual row of “Avg_Price_Cabin_DBL” with the total figure of “Inside”. Below is the one single measure provided for the reference (I’ve used the variable technique but in your file you can replace it with the measure branching technique, if you want) -
I’m also attaching the working of the PBIX file for the reference purposes.
Hoping you find this useful and meets your requirements that you’ve been looking for.
Important Note: The % results that you’re showing in the form of Excel screenshot is actually incorrect. For example, when a figure of 27,058 (Inside Plus - J2) is divided with 23,367 it should be 115.79% and not 118.60%. This is happening for most of the rows that you’re showing. Please check once
Thank you, Harsh!
It is now tested in the real model and it works perfectly.
After thoroughly studying your measure, I found out where were my mistakes when creating the right context.
Thanks again!
P.S. you are right about the Excel screenshot. The mistake there is found out.