The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I have a visual that sums total sales for a product category over time. For each period (usually month), I would like to sum the total number of product categories that aren't in the previous period.
Example Raw Data:
Date | Category | Product | Total |
31-Jan | Electronics | Watch | 43 |
31-Jan | Clothes | Shirt | 254 |
31-Jan | Clothes | Hat | 478 |
31-Jan | Misc | Giftcard | 2 |
28-Feb | Gear | Bike | 24 |
28-Feb | Gear | Helmet | 3 |
28-Feb | Electronics | Watch | 25 |
28-Feb | Clothes | Shirt | 576 |
31-Mar | Gear | Bike | 15 |
31-Mar | Electronics | Watch | 3 |
31-Mar | Misc | Giftcard | 1 |
Desired Results:
Date | New Category Count | Explanation |
31-Jan | The first date doesn't matter. It can also say 4. | |
28-Feb | 1 | Gear is not in January products. |
31-Mar | 1 | Misc is not in February products. It is in January, but that should not affect this calculation. |
I do not know why this doesn't let me make tables that are usable looking. This is a picture of what I have and what I want:
It's, in essence, nothing but an question of MoM comparison.
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Thank you this is very helpful. I had wanted count and not concat but that's pretty easy to fix. My only issue with this is that it's not possible to group up. If I want to add quarter or year to the table, it won't work correctly on quarter or year.
User | Count |
---|---|
16 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
25 | |
13 | |
12 | |
8 | |
8 |