Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
105 | |
96 | |
79 | |
66 | |
62 |
User | Count |
---|---|
145 | |
113 | |
105 | |
85 | |
65 |