This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Hi,
I am trying to write a DAX measure to count the no. of projects where the NET total spend this year is ZERO.
It mostly works but I have projects where they spend say $100 in February 2020, then -$100 in Nov 2020 - leading to a net total spend of ZERO - however, my DAX counts this project as a project that has non-zero spend.
In the table below - the no. of projects with zero net spend in 2020 should be two projects i.e. AAA and CCC
But my measure counts one project i.e. CCC
Here are my two measures - the second measure allows me to calculate 2020 spend.
| Project ID | Date | Value ($) |
| AAA | 1/1/2020 | -100 |
| AAA | 1/3/2020 | 50 |
| AAA | 1/4/2020 | 50 |
| BBB | 1/1/2020 | 50 |
| CCC | 1/1/2020 | 0 |
CCC | 1/2/2020 | 0 |
@Anonymous , Try a measure like
countx(filter(summarize('Table', 'Table'[Project ID], "_1",[CY20 Spend]+0),[_1]=0),[Project ID])
I assumed your measure CY20 Spend working correctly
or try measure like with date table
example
YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))
Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))
This year Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR('Date'[Date]),"12/31"))
Last year Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR(dateadd('Date'[Date],-1,Year)),"12/31"))
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.
@Anonymous
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 3 | |
| 3 | |
| 3 | |
| 3 | |
| 2 |
| User | Count |
|---|---|
| 8 | |
| 8 | |
| 7 | |
| 6 | |
| 6 |