Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
bilzebubnight
Regular Visitor

% of grand total of a measure shows incorrectly

I calculate a measure called total_dischrg, I would like to see the percentage number of the measure by each poverder, I put provider and measure in a table, but when I choose show as % of grand total, it shows incorrectly as shown below, some number is even > 100% which doesn't make sense. The total also is not correct.. Any solution for this issue? 

bilzebubnight_0-1636729217678.png

 

5 REPLIES 5
v-angzheng-msft
Community Support
Community Support

Hi, @bilzebubnight 

 

If the logic of the formula is correct, then you could try to replace the ALLEXCEPT function with Filter+All+Max:

FILTER ( ALL ( table ), 'table'[A] = MAX ( 'table'[A] ) )

I have occasionally encountered cases where the ALLEXCEPT function does not calculate correctly and FilterAllMax works.

 

like this:

vangzhengmsft_0-1637031894886.png

If this does not work, then please consdier sharing more details about it and posting expected result or a simple sample file without any sesentive information for further discussion.  It makes it easier to give you a solution.

 

 

Best Regards,
Community Support Team _ Zeon Zheng


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

bilzebubnight
Regular Visitor

final_dischrg is calculated by mutiply one column with other 2 measures together which shown below..

bilzebubnight_1-1636746680659.pngbilzebubnight_2-1636746760670.png

 

bilzebubnight_3-1636746772454.png

 

 

PaulOlding
Solution Sage
Solution Sage

Hi @bilzebubnight 

What's the code for final_dischrg measure?

And final_dischrg is calcualted by spe_ratio*zip_ratio* total_discharge(which is a column is the table). It may because the calculation of final_dischrg is also involved with provider_number?

Just noticed the screenshot is too small. I paste the formula below. Both of the two ratio are just a divend function combine some ALLEXCEPT

spe_ratio = CALCULATE(SUM(MUP_IHP_RY21_P02_V10_DY19_PrvSvc_0[Tot_Dschrgs]), ALLEXCEPT(MUP_IHP_RY21_P02_V10_DY19_PrvSvc_0,MUP_IHP_RY21_P02_V10_DY19_PrvSvc_0[Rndrng_Prvdr_CCN]), ALLEXCEPT(Main1,Main1[DRG Description]))/CALCULATE(SUM(MUP_IHP_RY21_P02_V10_DY19_PrvSvc_0[Tot_Dschrgs]), ALLEXCEPT(MUP_IHP_RY21_P02_V10_DY19_PrvSvc_0,MUP_IHP_RY21_P02_V10_DY19_PrvSvc_0[Rndrng_Prvdr_CCN]), ALLSELECTED(Main1[DRG Description]), ALL(Main1[DRG Description]))
 
zip_ratio = CALCULATE(CALCULATE(SUM('service area by hospital2020_final'[SumTOTAL_CASES]), ALLEXCEPT('service area by hospital2020_final', 'service area by hospital2020_final'[MEDICARE_PROV_NUM], 'service area by hospital2020_final'[ZIP_CODE], 'service area by hospital2020_final'[Home Office Name]))/CALCULATE(SUM('Service Area by hospital2020_final'[SumTOTAL_CASES]), ALLEXCEPT('service area by hospital2020_final', 'service area by hospital2020_final'[MEDICARE_PROV_NUM], 'service area by hospital2020_final'[Home Office Name])))

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors