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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

IF statement not populating proper result

hi All,

 

I have this PBI file which has few calcuated measures. I am trying to create a new company Column/measure as below:

If (Company Share < 2%, "Others",  [Company])

 

Howwever, if function is yielding proper results. The calculations are working fine. Infact, I created another calculated measure (Include/Exclude) to check if everything works fine. It seems there is another issue. 

 

Below is the sanitized version of the PBI file i am using:

https://www.dropbox.com/s/dvkse68bm8pndkm/for%20community.pbix?dl=0  

 

Can someone guide me to the solution. 

 

Regards,

Kaushik

 

10 REPLIES 10
V-pazhen-msft
Community Support
Community Support

@Anonymous 

Can you clarify what is the issue? I cant see any thing just from the model.

 

Best,
Paul

Anonymous
Not applicable

@V-pazhen-msft @AiolosZhao 

 

I the PBI file uploaded on the link, the New_company calculated column is not yielding the correct result. 

https://www.dropbox.com/s/dvkse68bm8pndkm/for%20community.pbix?dl=0 

Regards,

Kaushik

Hi @Anonymous ,

 

Please try to change it to below measure:

Measure = IF([Company Share]>0.02, MAX('Growth Growth Chart Input File'[Company]),"Others")

IF statement not populating proper result.PNG

 

Aiolos Zhao 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not applicable

@AiolosZhao 

 

Thanks for your reply. Although this solves the problem, I wanted it to be a calculated column. Some custom visuals that I am using would only consider calculate columns. 

 

Please help me build a calculated coloumn for this. 

Anonymous
Not applicable

Hi @Anonymous 

try this

 

Column=If(table[col]>0.02,Table[Company],"Others")

 

Thanks & regards,
Pravin Wattamwar
www.linkedin.com/in/pravin-p-wattamwar

If I resolve your problem Mark it as a solution and give kudos.

Anonymous
Not applicable

@Anonymous 

 

I already tried this - it populates "Others" for all entries.

Anonymous
Not applicable

Then may be actual values are less than 0.02 only.
Hence it is showing others only.

Thanks
Pravin
Anonymous
Not applicable

Compute company share in Calculated column only.
Can you share what is formula for company share?
Anonymous
Not applicable

Below is the formula for company share:

DIVIDE(CALCULATE(SUMX('Table',[Company Total]),ALLEXCEPT('Table','Table'[Company],'Table'[Country],'Table'[End Market],'Table'[Market Segment],'Table'[Region],'Table'[Segment],'Table'[Type],'Table'[Year])),CALCULATE(SUMX('Table',[Market Total]),ALLEXCEPT('Table','Table'[Company],'Table'[Country],'Table'[End Market],'Table'[Market Segment],'Table'[Region],'Table'[Segment],'Table'[Type],'Table'[Year])))

 

AiolosZhao
Memorable Member
Memorable Member

Hi @Anonymous ,

 

I have checked the PBI, could you please show me which column in table is wrong?

 

Aiolos Zhao





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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