Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello there,
I want to Count date rows, if the month and the year in the row are the same.
Is there a way to do this in DAX?
Beste regards
MSOMME
Solved! Go to Solution.
Hi,
MyMeasure =
SUMX (
'TABLE A',
0
+ ( EOMONTH ( 'TABLE A'[Created], 0 ) = EOMONTH ( 'TABLE A'[finished], 0 ) )
)
Regards
Hi,
MyMeasure =
SUMX (
'TABLE A',
0
+ ( EOMONTH ( 'TABLE A'[Created], 0 ) = EOMONTH ( 'TABLE A'[finished], 0 ) )
)
Regards
Thanks @Jos_Woolley ,
This seems to work so far, but unfortunatly this measures also counts the rows where The [Created] date and the [finished] date are empty. Is there a way to only count the rows, if they both have a value?
Best regards
MSOMME
Ok, then use this:
MyMeasure =
SUMX (
'TABLE A',
( EOMONTH ( 'TABLE A'[Created], 0 ) = EOMONTH ( 'TABLE A'[finished], 0 ) )
* ( 1 - ISBLANK ( 'TABLE A'[Created] ) )
)
Regards
@Anonymous , I am assuming you need a new column
New column =
var _eo = eomonth([Date], 0)
return
countx(filter(Table, eomonth([Date], 0) =_eo), [date])
I really wasn't specific on this one. I have two dates in my table. A "created" date and a "finished" date.
I want to count those Rows, where both dates have the same Month and Year, so the EOMONTH function sure comes in handy here.
I imagined something like this: COUNTROWS(TABLE A, IF(EOMONTH([Created],0)=EOMONTH([finished],0))
But I already know it isn't gonna work like that.
All help is very appreciated! @amitchandak
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
49 | |
25 | |
20 | |
15 | |
12 |
User | Count |
---|---|
57 | |
49 | |
44 | |
19 | |
18 |