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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
madhav2020
Frequent Visitor

DAX query to calculate counr based on group

Need to calculate the count of products based on the group:

  • Base or old month
  • Current month

Issue: Getting circular dependency error while calculation of count for current month

 

GroupBase MonthCurrent Month
A128
B2012
C1513
D119
E1020
F810
G7672
4 REPLIES 4
harshnathani
Community Champion
Community Champion

Hi @madhav2020 ,

 

Not very clear. 

 

Can you share sample data and expected output.

 


Regards,

Harsh Nathani


Appreciate with a Kudos!! (Click the Thumbs Up Button)

Did I answer your question? Mark my post as a solution!

Thanks Harsh.  This will give you more clarity i believe. 

 

Emp NamePeriod
GokulMar-20
RameshApr-20
RaghuMar-20
VenkatApr-20
RajiniMar-20
KamalMar-20

 

Need a DAX query to calculate total count of instances in period column.

 

Expected output:

Mar-20= 4

Apr-20= 2

 

 

HI @madhav2020 ,

 

 

Use the measure

Measure =
CALCULATE (
    COUNT ( 'Table'[Emp Name] ),
    ALLEXCEPT (
        'Table',
        'Table'[Period]
    )
)

 

1.jpg

 


Regards,

Harsh Nathani


Appreciate with a Kudos!! (Click the Thumbs Up Button)

Did I answer your question? Mark my post as a solution!

Thanks harsh. It works perfect

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.