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
I have this table:
I need to get at the month level, for each DocumentTypeId, the row corresponding to its highest UpdateTime and its maximum possible StateId.
For example for the month of January:
Thank you.
Solved! Go to Solution.
Hi, @Syndicate_Admin
According to your description, you want to filter the table by grouping by month according to [documentid]. Right?
Here are the steps you can follow:
(1)This is my test date:
(2)We can click “New Table” at the top of the interfaceand enter :
Table =
SELECTCOLUMNS (
ADDCOLUMNS (
SUMMARIZE (
'Test',
'Test'[month],
'Test'[DocumentTypeId],
"UpdateTime", MAX ( 'Test'[UpdateTime] ),
"Id", CALCULATE ( MAX ( 'Test'[Id] ) )
),
"StateId",
CALCULATE (
MAX ( 'Test'[StatedId] ),
'Test'[DocumentTypeId] = EARLIER ( [DocumentTypeId] )
&& 'Test'[UpdateTime] = EARLIER ( [UpdateTime] )
)
),
"Id", [Id],
"UpdateTime", [UpdateTime],
"StateId", [StateId],
"DocumentTypeId", [DocumentTypeId]
)
(3)Then we can get the table you need:
If this method can't meet your requirement, can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.
This is my test .pbix file : Filter_Dax.pbix
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Syndicate_Admin
According to your description, you want to filter the table by grouping by month according to [documentid]. Right?
Here are the steps you can follow:
(1)This is my test date:
(2)We can click “New Table” at the top of the interfaceand enter :
Table =
SELECTCOLUMNS (
ADDCOLUMNS (
SUMMARIZE (
'Test',
'Test'[month],
'Test'[DocumentTypeId],
"UpdateTime", MAX ( 'Test'[UpdateTime] ),
"Id", CALCULATE ( MAX ( 'Test'[Id] ) )
),
"StateId",
CALCULATE (
MAX ( 'Test'[StatedId] ),
'Test'[DocumentTypeId] = EARLIER ( [DocumentTypeId] )
&& 'Test'[UpdateTime] = EARLIER ( [UpdateTime] )
)
),
"Id", [Id],
"UpdateTime", [UpdateTime],
"StateId", [StateId],
"DocumentTypeId", [DocumentTypeId]
)
(3)Then we can get the table you need:
If this method can't meet your requirement, can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.
This is my test .pbix file : Filter_Dax.pbix
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Syndicate_Admin , refer if my blog on a similar topic can help
https://amitchandak.medium.com/power-bi-get-the-last-latest-value-of-a-category-d0cf2fcf92d0
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.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 44 | |
| 43 | |
| 38 | |
| 18 | |
| 16 |
| User | Count |
|---|---|
| 67 | |
| 63 | |
| 30 | |
| 30 | |
| 23 |