The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event! Join us in Stockholm, Sweden from September 24-27, 2024.
2-for-1 sale on June 20 only!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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"}) )
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
99 | |
93 | |
81 | |
63 | |
56 |
User | Count |
---|---|
248 | |
123 | |
111 | |
78 | |
74 |