Forum Discussion
HASONEVALUE() not working inside a Table definition formula
- 9 years ago
Anonymous
hi, please try this
Change your table Top to:
TablaTopVV=
filter(SUMMARIZE(Historia;Historia[Marca];Historia[Tema];Historia[Año];"Dato";SUM(Historia[Dato]));Historia[Tema]="PDM")Create a calculated Column:
TOP = if(RANKX(FILTER(TablaTopVV,TablaTopVV[Año]=EARLIER(TablaTopVV[Año])),TablaTopVV[Dato])<=5,TablaTopVV[Marca],"OTROS")
A new Measure:
ElDato = CALCULATE(SUM(TablaTopVV[Dato]),FILTER(TablaTopVV,TablaTopVV[Año]=[Año seleccionado]))
Finally in Visual Chart:
Ready!!
Thank you.
The issue is that it is requiered to include the rest of the data as "Others", so for example, calculating % over Total will include the Top 5 and the rest of the data as well.
Formulas work well when I hard coded the month number, just need to be dynamic. Data is read on a monthly basis and it is not nice to change hard coded formulas every month. Easy to forget!!!.
Can you share some sample data?
- Anonymous9 years agoNot applicable
Exactly,
I'll will work a little to strip sensitive data and create a sample in order to upload it.
Thank you.
- v-huizhn-msft9 years ago
Microsoft Employee
Hi Anonymous,
Have you resolved your issue? Where is your sample data?
In addition, you can create a measure to show the value in slicer.selected value=CALCULATE(Max(Table[data]),ALLSELECTED(Table))
Best Regards,Angelia
- Anonymous9 years agoNot applicable
Hi,
I have not resolved it yet.
I am attaching a link to download a stripped down page, isolating the issue.
Your help is greatly appreciated.
Regards
https://1drv.ms/u/s!AvtcxjkBouSbqk6Wg_E82PODDz3U
- Anonymous9 years agoNot applicable
Hi, I posted a reply with a link to a pbix file to doanload.
Regards
- Vvelarde9 years ago
Community Champion
Anonymous
hi, please try this
Change your table Top to:
TablaTopVV=
filter(SUMMARIZE(Historia;Historia[Marca];Historia[Tema];Historia[Año];"Dato";SUM(Historia[Dato]));Historia[Tema]="PDM")Create a calculated Column:
TOP = if(RANKX(FILTER(TablaTopVV,TablaTopVV[Año]=EARLIER(TablaTopVV[Año])),TablaTopVV[Dato])<=5,TablaTopVV[Marca],"OTROS")
A new Measure:
ElDato = CALCULATE(SUM(TablaTopVV[Dato]),FILTER(TablaTopVV,TablaTopVV[Año]=[Año seleccionado]))
Finally in Visual Chart:
Ready!!
- Anonymous9 years agoNot applicable