Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hello there,
I have a table that has daily inputs for job orders that looks like this:
| Date | Full Plate Number | Month |
| 1/1/2021 | Job Order 1 | Jan |
| 1/1/2021 | Job Order 2 | Jan |
| 1/1/2021 | Job Order 3 | Jan |
| 1/1/2021 | Job Order 4 | Jan |
| 1/2/2021 | Job Order 3 | Jan |
| 1/2/2021 | Job Order 4 | Jan |
| 1/2/2021 | Job Order 5 | Jan |
| 1/2/2021 | Job Order 6 | Jan |
| 2/1/2021 | Job Order 5 | Feb |
| 2/1/2021 | Job Order 6 | Feb |
| 2/1/2021 | Job Order 7 | Feb |
| 2/1/2021 | Job Order 8 | Feb |
| 2/2/2021 | Job Order 7 | Feb |
| 2/2/2021 | Job Order 8 | Feb |
| 2/2/2021 | Job Order 9 | Feb |
| 2/2/2021 | Job Order 10 | Feb |
| 2/2/2021 | Job Order 11 | Feb |
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:
| Month | Distinct Item of that month |
| Jan | Job Order 1 |
| Jan | Job Order 2 |
| Jan | Job Order 3 |
| Jan | Job Order 4 |
| Jan | Job Order 5 |
| Jan | Job Order 6 |
| Feb | Job Order 5 |
| Feb | Job Order 6 |
| Feb | Job Order 7 |
| Feb | Job Order 8 |
| Feb | Job Order 9 |
| Feb | Job Order 10 |
| Feb | Job Order 11 |
so far I have tried..
Solved! Go to Solution.
@amitchandak what ended up working thanks to your inspiration was
CALCULATETABLE(CROSSJOIN(DISTINCT([Date(Month)]),DISTINCT([Job Order])),Filter)
@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])
@amitchandak that is giving me all the months I only want the months that exist
@amitchandak what ended up working thanks to your inspiration was
CALCULATETABLE(CROSSJOIN(DISTINCT([Date(Month)]),DISTINCT([Job Order])),Filter)
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.
| User | Count |
|---|---|
| 48 | |
| 40 | |
| 37 | |
| 20 | |
| 15 |
| User | Count |
|---|---|
| 70 | |
| 67 | |
| 32 | |
| 27 | |
| 25 |