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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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