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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Multiple Items but want to count only once rest 0

Need help in solving this problem. I have multiple category with differenc operation but i want show only once evern there are multiple operations.
Category	Opno	
100	10	
100	20	
100	30	
100	40	
100	50	
200	10	
200	20	
200	30	
300	10	
300	20	
300	30	
500	10	
600	10	
		
		
Output		
Category	Opno	Count(Category)
100	10	1
100	20	0
100	30	0
100	40	0
100	50	0
200	10	1
200	20	0
200	30	0
300	10	1
300	20	0
300	30	0
500	10	1
600	10	1
1 ACCEPTED SOLUTION
V-lianl-msft
Community Support
Community Support

Hi @Anonymous ,

 

Try to create a measure like this:

Measure = IF(MAX('table'[opno])=CALCULATE(FIRSTNONBLANK('table'[opno],1),ALLEXCEPT('table','table'[categories])),1,0)

test_only once.PNG

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
V-lianl-msft
Community Support
Community Support

Hi @Anonymous ,

 

Try to create a measure like this:

Measure = IF(MAX('table'[opno])=CALCULATE(FIRSTNONBLANK('table'[opno],1),ALLEXCEPT('table','table'[categories])),1,0)

test_only once.PNG

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Greg_Deckler
Super User
Super User

Perhaps:

 

Count Column =
  VAR __Min = MINX(FILTER('Table',[Category] = EARLIER([Category])),[Opno])
RETURN
  IF([Opno] = __Min,1,0)

  


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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