Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I have a table like this
| Item | Import date | Export date |
| A1 | Jan 01, 2018 | Mar 03, 2020 |
| A2 | Jan 04, 2018 | Feb 10, 2018 |
| A3 | Mar 22, 2018 | Apr 29, 2018 |
| A4 | Dec 19, 2018 | Jan 22, 2019 |
| A5 | Feb 11, 2019 | Mar 12, 2019 |
| A6 | Feb 15, 2019 | May 17, 2019 |
| A7 | Jan 08, 2020 | Jan 10, 2020 |
| A8 | Jan 09, 2020 | Apr 15, 2020 |
| A9 | Mar 16, 2020 | Mar 20, 2020 |
My task is to count the items that have import dates and export dates of Quater I in the same year, then compare with last years.
The result is expected as:
Year Number of items
2018 1
2019 1
2020 2
Please advise me. Thank you alot.
Solved! Go to Solution.
Hi @Thuy ,
Based on your description, you want to calculate the number of items when the two dates and years are the same and the first quarter.
You can try the DAX below:
Measure =
CALCULATE (
COUNT ( 'table'[Item] ),
FILTER (
'table',
QUARTER ( 'table'[Export date] ) = 1
&& QUARTER ( 'table'[Import date] ) = 1
&& YEAR ( 'table'[Export date] ) = YEAR ( 'table'[Import date] )
)
)
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Thuy ,
Based on your description, you want to calculate the number of items when the two dates and years are the same and the first quarter.
You can try the DAX below:
Measure =
CALCULATE (
COUNT ( 'table'[Item] ),
FILTER (
'table',
QUARTER ( 'table'[Export date] ) = 1
&& QUARTER ( 'table'[Import date] ) = 1
&& YEAR ( 'table'[Export date] ) = YEAR ( 'table'[Import date] )
)
)
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 41 | |
| 39 | |
| 37 | |
| 29 | |
| 24 |
| User | Count |
|---|---|
| 119 | |
| 100 | |
| 72 | |
| 69 | |
| 65 |