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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Error when create calculated column (Norm.Dist) in Power BI

Hi Experts,

 

As per title, below is my code in calculated column:
******

Normalized =
var AvgStartYear = MIN('**DM-InvestabilityIndex**'[Year])
var AvgeEdYear = 2022
var Mean = CALCULATE(AVERAGE('**DM-InvestabilityIndex**'[Value]),ALLEXCEPT('**DM-InvestabilityIndex**','**DM-InvestabilityIndex**'[Type],'**DM-InvestabilityIndex**'[CITY]),AND( '**DM-InvestabilityIndex**'[Year]>=AvgStartYear,'**DM-InvestabilityIndex**'[Year]<=AvgeEdYear))
var SD = CALCULATE(STDEV.S('**DM-InvestabilityIndex**'[Value]),ALLEXCEPT('**DM-InvestabilityIndex**','**DM-InvestabilityIndex**'[Type],'**DM-InvestabilityIndex**'[CITY]),AND('**DM-InvestabilityIndex**'[Year]>=AvgStartYear,'**DM-InvestabilityIndex**'[Year]<=AvgeEdYear))
var ND = NORM.DIST('**DM-InvestabilityIndex**'[Value],Mean,SD,TRUE())*100
return
ND
******
I also attach part of the image of my table (<2000 rows) in below:
TWMY1014_0-1664430723474.png

I have succsssfully use same DAX in another table but fail in this.

Appreciate for your advise. Thanks a lot.



1 ACCEPTED SOLUTION
Anonymous
Not applicable

HI, 

 

I finally figure out.  Normal distribution cannot have 0 standard deviation, which I have for some city, i.e. all vlaue in entire time series was the same.  I just add an if function to become 0.00000001 to minimise effect if the result was 0 to SD dax, then it works.

View solution in original post

3 REPLIES 3
v-yalanwu-msft
Community Support
Community Support

Hi, @Anonymous ;

Sorry I can't reproduce your formula, can you share the wrong information tip, or a simple file (after removing sensitive information)?


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hi v-yalanwu-msft,

 

Thanks for your reply. Seems I can't attach the pbix file here so i screen cap for you.  Thanks.

TWMY1014_0-1664526267233.png

 

Anonymous
Not applicable

HI, 

 

I finally figure out.  Normal distribution cannot have 0 standard deviation, which I have for some city, i.e. all vlaue in entire time series was the same.  I just add an if function to become 0.00000001 to minimise effect if the result was 0 to SD dax, then it works.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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