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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Creating a distinct table for each month using a Dates Table and another table

Hello there,

 

I have a table that has daily inputs for job orders that looks like this:

 

DateFull Plate NumberMonth
1/1/2021Job Order 1Jan
1/1/2021Job Order 2Jan
1/1/2021Job Order 3Jan
1/1/2021Job Order 4Jan
1/2/2021Job Order 3Jan
1/2/2021Job Order 4Jan
1/2/2021Job Order 5Jan
1/2/2021Job Order 6Jan
2/1/2021Job Order 5Feb
2/1/2021Job Order 6Feb
2/1/2021Job Order 7Feb
2/1/2021Job Order 8Feb
2/2/2021Job Order 7Feb
2/2/2021Job Order 8Feb
2/2/2021Job Order 9Feb
2/2/2021Job Order 10Feb
2/2/2021Job Order 11Feb

 

I'm trying to create a table using DAX that would give me a distinct count of a given month generating a table that looks like this:

 

MonthDistinct Item of that month
JanJob Order 1
JanJob Order 2
JanJob Order 3
JanJob Order 4
JanJob Order 5
JanJob Order 6
FebJob Order 5
FebJob Order 6
FebJob Order 7
FebJob Order 8
FebJob Order 9
FebJob Order 10
FebJob Order 11

 

so far I have tried..

JobOrderSummery =
Var _Date = GENERATE(CALENDAR(DATE(2021,1,1),DATE(YEAR(TODAY()),MONTH(TODAY()),DAY(TODAY()))),VAR CurrentDate = [Date])
RETURN
CROSSJOIN(CALENDAR(DATE(2021,1,1),DATE(YEAR(TODAY()),MONTH(TODAY()),DAY(TODAY()))),CALCULATETABLE(SUMMARIZE(MaintParetoTbl,MaintParetoTbl[Job Order Number]),MaintParetoTbl[Job Order Number] <> "",MaintParetoTbl[Date(Month)] = [Date] ))
1 ACCEPTED SOLUTION
Anonymous
Not applicable

@amitchandak what ended up working thanks to your inspiration was

 

CALCULATETABLE(CROSSJOIN(DISTINCT([Date(Month)]),DISTINCT([Job Order])),Filter)

 

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , Have you tried like

crossjoin(distinct(Table[Date Full]), Distinct( Table[Plate Number])

 

or

 

crossjoin(CALENDAR(DATE(2021,1,1),TODAY()), Distinct( Table[Plate Number])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak that is giving me all the months I only want the months that exist

Anonymous
Not applicable

@amitchandak what ended up working thanks to your inspiration was

 

CALCULATETABLE(CROSSJOIN(DISTINCT([Date(Month)]),DISTINCT([Job Order])),Filter)

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors