Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Hai-Quan
Regular Visitor

Seeking assistance with a measure, the problem description is in the table

image.png

student idsubjectsales amount
001a700
001a-500
001b400
001c600
002a500
002b400
002d300
003a500
003b400
003c300
003c-300
004a400
004b300
005a200
2 REPLIES 2
technolog
Super User
Super User

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.

Anonymous
Not applicable

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.

vyangliumsft_0-1693447353830.png

3. Result:

vyangliumsft_1-1693447353832.png

 

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

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.