The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi Community :
i need your help to get this done
what I need is to get the percentage of "positive" minus "don't know" for every "type"
then I need the sum of this percentages for two "types " , for example ( Emotion + finanace )
the pbix file is included
Solved! Go to Solution.
Hi @haniizz ,
Here are the steps you can follow:
1. Create measure.
positive minus don't know =
var _select=SELECTCOLUMNS('FACT_Answer',"Type",'FACT_Answer'[Type])
var _columnpo=SELECTCOLUMNS(FILTER(ALL(FACT_Answer),'FACT_Answer'[Type] in _select&&'FACT_Answer'[Type]=MAX('FACT_Answer'[Type])&&'FACT_Answer'[Group]="Positive"),"ID1",[ID])
var _count1=
COUNTX(
FILTER(ALL('DIM_User'),'DIM_User'[ID] in _columnpo),[Gender])
var _columnd0=SELECTCOLUMNS(FILTER(ALLSELECTED(FACT_Answer),'FACT_Answer'[Type] in _select&&'FACT_Answer'[Type]=MAX('FACT_Answer'[Type])&&'FACT_Answer'[Group]="Do Not Know"),"ID1",[ID])
var _count2=
COUNTX(
FILTER(ALL('DIM_User'),'DIM_User'[ID] in _columnd0),[ID])
return
_count1 - _count2
Emotion + finanace =
var _table1=
SUMMARIZE('FACT_Answer','FACT_Answer'[Type],"Value",[positive minus don't know])
return
IF(
HASONEVALUE('FACT_Answer'[Type]),[positive minus don't know],SUMX(_table1,[Value]))
2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @haniizz ,
Here are the steps you can follow:
1. Create measure.
positive minus don't know =
var _select=SELECTCOLUMNS('FACT_Answer',"Type",'FACT_Answer'[Type])
var _columnpo=SELECTCOLUMNS(FILTER(ALL(FACT_Answer),'FACT_Answer'[Type] in _select&&'FACT_Answer'[Type]=MAX('FACT_Answer'[Type])&&'FACT_Answer'[Group]="Positive"),"ID1",[ID])
var _count1=
COUNTX(
FILTER(ALL('DIM_User'),'DIM_User'[ID] in _columnpo),[Gender])
var _columnd0=SELECTCOLUMNS(FILTER(ALLSELECTED(FACT_Answer),'FACT_Answer'[Type] in _select&&'FACT_Answer'[Type]=MAX('FACT_Answer'[Type])&&'FACT_Answer'[Group]="Do Not Know"),"ID1",[ID])
var _count2=
COUNTX(
FILTER(ALL('DIM_User'),'DIM_User'[ID] in _columnd0),[ID])
return
_count1 - _count2
Emotion + finanace =
var _table1=
SUMMARIZE('FACT_Answer','FACT_Answer'[Type],"Value",[positive minus don't know])
return
IF(
HASONEVALUE('FACT_Answer'[Type]),[positive minus don't know],SUMX(_table1,[Value]))
2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
thank you so much Liu , that solved my issue
I appreciate it
someone help me with this