Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
I have a table as follows:
Header1 | Header2 | Flag |
Q123 | CL | 1 |
Q132 | GL(camp) | 0 |
Q321 | GL | 1 |
Q231 | CL (camp) | 0 |
Q312 | CL | 1 |
Q112 | GL | 1 |
I have created a "Flag" measure based on "Header2" column. So, only for CL and GL, the flag will be 1, else it will 0.
Now I want to sum the "Flag" measure so that it will give me a count of total CL and GL. How do I do that?
So far I have done the following and nothing has worked:
1. exclude test = SUMX(VALUES(Table[Header2], if([Flag]=1)))
2. exclude test = CALCULATE(DISTINCTCOUNT(('Table'[Header1]), FILTER('Table', 'Table'[Flag]=1)))
3. exclude test = CALCULATE(COUNT(Table[Header1]), KEEPFILTERS(Table[Flag]=1))
Hi,
To your Table visual, drag the Header 2 field. Write this measure
Measure = SUMX('Table',[Flag])
Hope this helps.
Sumx(filter(Summarize(Table, Table[Header 1], Table[Header 2], "_1", [Flag]),[Flag] =1) , [Header 1])
or
countrows(filter(Table, Table[Header 2] in {"CL", "GL"}) )
User | Count |
---|---|
96 | |
86 | |
78 | |
72 | |
67 |
User | Count |
---|---|
110 | |
104 | |
84 | |
65 | |
63 |