Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
I have 2 table as below and wanted the result after subtracting the count and want to show in visual but this is not showing me the correct result, how I can do it using DAX, basically I am trying to subtract the count , Table1.Count - Table2.Count and want to achieve result month wise.
Table1
Category | Month | Count |
Cat1 | Jul-23 | 1 |
Cat1 | Oct-23 | 7 |
Cat1 | Nov-23 | 14 |
Cat1 | Dec-23 | 29 |
Cat1 | Jan-24 | 72 |
Cat1 | Feb-24 | 132 |
Cat1 | Mar-24 | 177 |
Cat1 | Apr-24 | 216 |
Cat1 | May-24 | 268 |
Cat1 | Jun-24 | 305 |
Cat1 | Jul-24 | 330 |
Cat1 | Aug-24 | 360 |
Cat1 | Sep-24 | 388 |
Table2
Category | Month | Count |
Cat2 | Oct-23 | 1 |
Cat2 | Nov-23 | 2 |
Cat2 | Jan-24 | 16 |
Cat2 | Feb-24 | 36 |
Cat2 | Mar-24 | 96 |
Cat2 | Apr-24 | 125 |
Cat2 | May-24 | 168 |
Cat2 | Jun-24 | 201 |
Cat2 | Jul-24 | 242 |
Cat2 | Aug-24 | 299 |
Cat2 | Sep-24 | 334 |
Result
Month | Count |
Jul-23 | 1 |
Oct-23 | 6 |
Nov-23 | 12 |
Dec-23 | 29 |
Jan-24 | 56 |
Feb-24 | 96 |
Mar-24 | 81 |
Apr-24 | 91 |
May-24 | 100 |
Jun-24 | 104 |
Jul-24 | 88 |
Aug-24 | 61 |
Sep-24 | 54 |
Solved! Go to Solution.
Download my PBIX fiel with the data and example shown below
Create a Date Table and mark it as a date table then create a relationship between it and your 2 other tables.
Create this measure
Measure = SUM(Table1[Count]) - SUM(Table2[Count])
and display it in a table
Note that I've formatted the date column to display just the Month-Year
Regards
Phil
Proud to be a Super User!
Download my PBIX fiel with the data and example shown below
Create a Date Table and mark it as a date table then create a relationship between it and your 2 other tables.
Create this measure
Measure = SUM(Table1[Count]) - SUM(Table2[Count])
and display it in a table
Note that I've formatted the date column to display just the Month-Year
Regards
Phil
Proud to be a Super User!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
17 | |
10 | |
10 | |
8 | |
6 |
User | Count |
---|---|
20 | |
18 | |
16 | |
13 | |
10 |