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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
andrmh
Helper II
Helper II

DAX query assistance

Hi All,

 

I have what should be a very simple query.

 

(Note - this is ficticious data to describe what im trying to do)

 

I have a Table, Fruits.
In it, is an Id, a date, a category.

 

(SAMPLE)

sample fruit.png

and so on...

 

I am displaying a table, which contains a breakdown by month/year (related to a date dimension), the category, and the count of all fruits, slided by date and category as follows:

Fruits.PNG

 

What I need, is the Period column at the end. This should simply be the sum of all fruit for that month (as displayed).
However I cant seem to crack it.

 

The end goal, is to use that monthly total to arrive at a % of total that each category represents. However we have a requirement to display the totals used to arrive at that percentage also.

 

Items is simply a Count of distinct ID's, no filters or anything like that applied. Save what the slicers for the visual itself are applying.

 

I have tried using ALLEXCEPT but dont seem to be making any headway.

I have tried:

Period = CALCULATE( count(Fruits[Id]), ALLEXCEPT(vDimDate, vDimDate[Date]))

Period = CALCULATE( count(Fruits[Id]), ALLEXCEPT(vDimDate, vDimDate[MonthNameLabel]))

Period = CALCULATE( count(Fruits[Id]), ALLEXCEPT(Fruits, Fruits[Date]))

 

None seem to yield the right result. Im likely missing something very very simple at the moment.

 

Assistance appreciated.

 

Thanks.

1 ACCEPTED SOLUTION
andrmh
Helper II
Helper II

Period = CALCULATE( count(Fruits[Id]), ALLSELECTED(Fruits[Category]))

 

seems to have done the trick.

View solution in original post

1 REPLY 1
andrmh
Helper II
Helper II

Period = CALCULATE( count(Fruits[Id]), ALLSELECTED(Fruits[Category]))

 

seems to have done the trick.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors