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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Mnassar4
Regular Visitor

DAX Quarter

Hi Guys ,

I have a data per empolyee each quarter with total number of contribution column .. I wan to create a column to check wether the total number of contirbution is > 11 for each empolyee per Quarter.. can you please help on that  ?

 

 

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@Mnassar4 Hard to be specific without sample data but probably something like:

Measure =
  VAR __Employee = MAX('Table'[Employee])
  VAR __Quarter = MAX('Table'[Quarter])
  VAR __Table = FILTER(ALL('Table'),[Employee]=__Employee && [Quarter]=__Quarter)
RETURN
  IF(COUNTROWS(__Table)>11,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...

View solution in original post

4 REPLIES 4
Mnassar4
Regular Visitor

@Greg_Deckler .. Thanks it workd with Calculatetable 🙂 

Mnassar4
Regular Visitor

@Greg_Deckler sorry for my late reply , but what if Quarter & Empolyee is in 2 different data tables and tables are connected by relationship already .. 

 VAR __Table = FILTER(ALL('Table'),[Employee]=__Employee && [Quarter]=__Quarter

 in the above line it is assuming that 'Table' is the same , that's how Filter Function works , but actually Quarter & Empolyee Columns are in different tables .. so How can we adapt the measure then ? .. Thanks in Advance 

@Mnassar4 Use CALCULATETABLE for that, this allows you to apply a filter from a related table or even use TREATAS.


@ 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...
Greg_Deckler
Super User
Super User

@Mnassar4 Hard to be specific without sample data but probably something like:

Measure =
  VAR __Employee = MAX('Table'[Employee])
  VAR __Quarter = MAX('Table'[Quarter])
  VAR __Table = FILTER(ALL('Table'),[Employee]=__Employee && [Quarter]=__Quarter)
RETURN
  IF(COUNTROWS(__Table)>11,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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.

Top Solution Authors