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!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi, I have a table below that shows the number of instances that happened on a specific date in the next row. I need 2 measures that show:
2023 - 4798 instances
2024 - 3555 instances
| Instances | Date |
| 1157 | 10/04/2023 |
| 1527 | 10/07/2023 |
| 1157 | 10/10/2023 |
| 957 | 10/01/2023 |
| 1126 | 10/04/2023 |
| 1163 | 10/07/2023 |
| 1066 | 10/10/2023 |
How can this be done please?
Solved! Go to Solution.
@RichOB , Try using
Instances_2023 =
CALCULATE(
SUM('Table'[Instances]),
YEAR('Table'[Date]) = 2023
)
Instances_2024 =
CALCULATE(
SUM('Table'[Instances]),
YEAR('Table'[Date]) = 2024
)
Proud to be a Super User! |
|
@RichOB , Try using
2023_Instances =
CALCULATE(
COUNT('Table'[Instances]),
FILTER(
'Table',
'Table'[Date] >= DATE(2023, 1, 4) && 'Table'[Date] <= DATE(2023, 3, 31)
)
)
Proud to be a Super User! |
|
Hi @RichOB
Thank you very much bhanu_gautam for your prompt reply.
I tested your measure and bhanu_gautam's measure separately and both give correct results. If your code does not work, check that the data type of the date is correct.
If there are any potential filters applied to your report that may also affect the calculation. You may consider using the ALL function to ignore these filters.
Filter ALL 2023_Instances =
CALCULATE(
COUNT('Table'[Instances]),
FILTER(
ALL('Table'),
'Table'[Date] >= DATE(2023, 1, 4) && 'Table'[Date] <= DATE(2024, 3, 31)
)
)
Regards,
Nono Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @RichOB
Thank you very much bhanu_gautam for your prompt reply.
I tested your measure and bhanu_gautam's measure separately and both give correct results. If your code does not work, check that the data type of the date is correct.
If there are any potential filters applied to your report that may also affect the calculation. You may consider using the ALL function to ignore these filters.
Filter ALL 2023_Instances =
CALCULATE(
COUNT('Table'[Instances]),
FILTER(
ALL('Table'),
'Table'[Date] >= DATE(2023, 1, 4) && 'Table'[Date] <= DATE(2024, 3, 31)
)
)
Regards,
Nono Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@RichOB , Try using
Instances_2023 =
CALCULATE(
SUM('Table'[Instances]),
YEAR('Table'[Date]) = 2023
)
Instances_2024 =
CALCULATE(
SUM('Table'[Instances]),
YEAR('Table'[Date]) = 2024
)
Proud to be a Super User! |
|
Hi @bhanu_gautam Thanks for this.
How would I get the count of instances between 1/4/2023 - 3/31/2024?
Usually I would do this measure like below, but it's not working:
@RichOB , Try using
2023_Instances =
CALCULATE(
COUNT('Table'[Instances]),
FILTER(
'Table',
'Table'[Date] >= DATE(2023, 1, 4) && 'Table'[Date] <= DATE(2023, 3, 31)
)
)
Proud to be a Super User! |
|
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 103 | |
| 80 | |
| 62 | |
| 51 | |
| 45 |