Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hi there,
I have created a measure that calculates the occurrence (i.e. how many times) of a particular code occurs (i.e.) and returns the number if it is more than two. My measure looks like as follow:
Solved! Go to Solution.
@Dunner2020 ,Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
Try this in beween
test_unknown =
var _count = CALCULATE(DISTINCTCOUNT('Table'[ID]),FILTER(RELATEDTABLE('Table2'),'Table2'[Code]="0"))
Var _Tab = addcolumns(summarize('Table', 'Table'[Station],"_1" ,CALCULATE(DISTINCTCOUNT('Table'[ID]),FILTER(RELATEDTABLE('Table2'),'Table2'[Code]="0"))), "_2", CALCULATE(Sumx('Table', _1), allexpect(Table, Table[Station])))
Return
sumx(filter(_tab, _2>2),_1)
@Dunner2020 , I think need to force row context of station
try measure like
test_unknown =
var _count = CALCULATE(DISTINCTCOUNT('Table'[ID]),FILTER(RELATEDTABLE('Table2'),'Table2'[Code]="0"))
Return
if(CALCULATE(_count, allexpect(Table, Table[Station])) >2,_count)
@amitchandak , I used the measure you mentioned in the reply but it did not change the result. Still getting 5A code in detail informaiton table.
@Dunner2020 ,Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
Try this in beween
test_unknown =
var _count = CALCULATE(DISTINCTCOUNT('Table'[ID]),FILTER(RELATEDTABLE('Table2'),'Table2'[Code]="0"))
Var _Tab = addcolumns(summarize('Table', 'Table'[Station],"_1" ,CALCULATE(DISTINCTCOUNT('Table'[ID]),FILTER(RELATEDTABLE('Table2'),'Table2'[Code]="0"))), "_2", CALCULATE(Sumx('Table', _1), allexpect(Table, Table[Station])))
Return
sumx(filter(_tab, _2>2),_1)
User | Count |
---|---|
88 | |
88 | |
74 | |
69 | |
57 |
User | Count |
---|---|
136 | |
109 | |
91 | |
83 | |
69 |