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.
student id | subject | sales amount |
001 | a | 700 |
001 | a | -500 |
001 | b | 400 |
001 | c | 600 |
002 | a | 500 |
002 | b | 400 |
002 | d | 300 |
003 | a | 500 |
003 | b | 400 |
003 | c | 300 |
003 | c | -300 |
004 | a | 400 |
004 | b | 300 |
005 | a | 200 |
I hope this message finds you well. I've noticed that this solution remain unresolved. If any of you have managed to find a resolution to the issue, I kindly request that you share your solution for the benefit of the entire community. Alternatively, if you're still facing challenges, please do let us know as well.
Your insights and updates will greatly assist others who might be encountering the same challenge.
Hi @Hai-Quan ,
Here are the steps you can follow:
1. Create measure.
Measure =
var _column=SELECTCOLUMNS(FILTER(ALL('Table'),'Table'[student id]=MAX('Table'[student id])),"subject",'Table'[subject])
var _if=
IF(
OR(
"a" in _column && "b"in _column &&"c" in _column,"a" in _column && "b"in _column &&"d" in _column),1,0)
var _groupsum=
SUMX(FILTER(ALL('Table'),'Table'[student id]=MAX('Table'[student id])&&'Table'[subject]=MAX('Table'[subject])),[sales amount])
return
IF(
_if =1 &&_groupsum<=0,0,_if)
Flag =
IF(
0 in SELECTCOLUMNS(FILTER(ALL('Table'),'Table'[student id]=MAX('Table'[student id])),"column",[Measure]),0,1)
Count =
CALCULATE(DISTINCTCOUNT('Table'[student id]),ALLSELECTED('Table'))
2. Place [Flag]in Filters, set is=1, apply filter.
3. 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
User | Count |
---|---|
25 | |
10 | |
8 | |
6 | |
6 |
User | Count |
---|---|
31 | |
12 | |
10 | |
10 | |
9 |