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
Hi
I have the below data set
| ID | Date 1 | Date 2 |
| 1 | 01/01/2023 | |
| 1 | 02/01/2023 | 02/01/2023 |
| 1 | 03/01/2023 | 03/01/2023 |
| 2 | 04/01/2023 | |
| 2 | 05/01/2023 | 05/01/2023 |
I have put the data in a mtrix table so that I can see the ID number and the total number of date 1 for each ID and then total number of Date 2. I have put them in a matrix as a count of dates. I want to add a column in to look at the total differences like below. What formula do I use to count the total number of date 1 and then subtract against the total of Date 2 so I can get the difference. hope that makes sense, thank you
| ID | Date 1 total | Date 2 total | Difference |
| 1 | 3 | 2 | 1 |
| 2 | 2 | 1 | 1 |
@WJ876400 Maybe:
totalDifference Measure =
VAR __Date1 = COUNTROWS(FILTER('Table',[Date 1] <> BLANK())
VAR __Date2 = COUNTROWS(FILTER('Table',[Date 2] <> BLANK())
VAR __Result = __Date1 - __Date2
RETURN
__Result
Thank you for the quick response, I got an error on my measure can you see where I went wrong?
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 37 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 133 | |
| 88 | |
| 85 | |
| 68 | |
| 64 |