Forum Discussion
If statement doesn't work
elif , If this is a column, this will not work
POS Type NEW = IF([is grater] = 1, "NPI", 'Product'[POS type])
It needs to be a measure
example
POS Type NEW = IF([is grater] = 1, "NPI", max('Product'[POS type]) )
Hi amitchandak
I tried both of them but still not working. When I try your suggestion it gives me just 2 Product Type but has to be 5 like Core Product, Identity, NPI, Custom, outofscope, and the NPI calculation is wrong as well.
- amitchandak4 years agoSuper User
elif , This will not work as column,
You have create a measure as, you are using measure in calculation
POS Type NEW = IF([is grater] = 1, "NPI", max('Product'[POS type]) )
Not get this working as a Column, you need an independent table(assume POS Type) with these two values. using a group by NPI name you need create a new measure to get this working
new Measure
Sumx(filter(Values(Table[MPI Name]), [POS Type NEW] = max(POS Type[POS Type])), [measure])refer this blog or video for steps
Dynamic Segmentation Bucketing Binning
https://community.powerbi.com/t5/Quick-Measures-Gallery/Dynamic-Segmentation-Bucketing-Binning/m-p/1387187#M626
Dynamic Segmentation, Bucketing or Binning: https://youtu.be/CuczXPj0N-k