Forum Discussion
FOREACH / WHERE Statement in DAX
- 4 years ago
Hi,
In DAX it could be straightforward :
If you make a table with YearMonth (in lines) and Week number
with a COUNT or DISTINCTCOUNT as calculation, you'll get it.Or a DAX measure could be something like :
# of Week = CALCULATE( DISTINCTCOUNT( MonCalendrier[NumSemISO] ) , ALLEXCEPT( MonCalendrier , MonCalendrier[Annee-Mois] ) )Tell us if it works and mark it as solved or tell us more about your issue.
- 4 years ago
Yes, not sure how I missed it - suspect I was overcomplicating things 🙂 - but the below seems to have worked:
Weeks in Month = CALCULATE(DISTINCTCOUNT([Week of Month]), ALLEXCEPT('DateMaster', DateMaster[Fiscal YearMonth]))
Hi,
In DAX it could be straightforward :
If you make a table with YearMonth (in lines) and Week number
with a COUNT or DISTINCTCOUNT as calculation, you'll get it.
Or a DAX measure could be something like :
# of Week = CALCULATE( DISTINCTCOUNT( MonCalendrier[NumSemISO] ) ,
ALLEXCEPT( MonCalendrier , MonCalendrier[Annee-Mois] ) )
Tell us if it works and mark it as solved or tell us more about your issue.
- PaulBoden4 years ago
Helper I
Yes, not sure how I missed it - suspect I was overcomplicating things 🙂 - but the below seems to have worked:
Weeks in Month = CALCULATE(DISTINCTCOUNT([Week of Month]), ALLEXCEPT('DateMaster', DateMaster[Fiscal YearMonth]))