Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
I have a table that lists invoices along with a date column that is formatted like 12/12/2012 12:00:00 AM. I want to find (through DAX) the most frequently occuring month and week but am now sure how.
Solved! Go to Solution.
Hi,
Try this
Invoice count=COUNTA(Data[Invoice Number])
You may sort the measure in descending order.
Hi @MichaiahGartner,
As davehus metioned, I made one sample for your reference.
1. Enter the sample data and create some calculated columns in the table.
Month = FORMAT(Invoice[Date],"mmmm")
weeknum = WEEKNUM(Invoice[Date])
2. Create the measures to achieve your goal.
Invoice Count Measure = COUNT(Invoice[Month])
Top Month =
IF (
NOT ( ISBLANK ( Invoice[Invoice Count Measure] ) ),
MAXX (
TOPN (
1,
SUMMARIZE (
Invoice,
Invoice[Month],
"Invoice Count", Invoice[Invoice Count Measure]
),
[Invoice Count]
),
Invoice[Month]
)
)
Top week =
IF (
NOT ( ISBLANK ( Invoice[Invoice Count Measure] ) ),
MAXX (
TOPN (
1,
SUMMARIZE (
Invoice,
Invoice[weeknum],
"Invoice Count", Invoice[Invoice Count Measure]
),
[Invoice Count]
),
Invoice[weeknum]
)
)
For more details, please check the pbix as attached.
Regards,
Frank
Hi @MichaiahGartner,
As davehus metioned, I made one sample for your reference.
1. Enter the sample data and create some calculated columns in the table.
Month = FORMAT(Invoice[Date],"mmmm")
weeknum = WEEKNUM(Invoice[Date])
2. Create the measures to achieve your goal.
Invoice Count Measure = COUNT(Invoice[Month])
Top Month =
IF (
NOT ( ISBLANK ( Invoice[Invoice Count Measure] ) ),
MAXX (
TOPN (
1,
SUMMARIZE (
Invoice,
Invoice[Month],
"Invoice Count", Invoice[Invoice Count Measure]
),
[Invoice Count]
),
Invoice[Month]
)
)
Top week =
IF (
NOT ( ISBLANK ( Invoice[Invoice Count Measure] ) ),
MAXX (
TOPN (
1,
SUMMARIZE (
Invoice,
Invoice[weeknum],
"Invoice Count", Invoice[Invoice Count Measure]
),
[Invoice Count]
),
Invoice[weeknum]
)
)
For more details, please check the pbix as attached.
Regards,
Frank
Hi @MichaiahGartner,
Does that make sense? If so, kindly mark my answer as a solution to close the case.
Regards,
Frank
Hi,
Try this
Invoice count=COUNTA(Data[Invoice Number])
You may sort the measure in descending order.
Top Month =
IF (
NOT ( ISBLANK ( "Invoice Count Measure" ) ),
MAXX (
TOPN (
1,
SUMMARIZE (
'Your Table',
'Date Table'[Month Name],
"Invoice Count", "Invoice Count Measure"
),
[Invoice Count]
),
'Date Table'[Month Name]
)
)Hi - Please see the measure I've included for you. I'm assuming that you have a date table linked to the table and the measure is written with this in mind.
Hopefull this helps.
D
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.