Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I have a sample data:
Week number | Category | Sales |
1 | MessT | 1234 |
2 | WerkZ | 2345 |
From this I created a matrix table which calculates a sum of sales in a given week. it looks like in a screenshot.
I read docs about how to create a measure with differences between these categories and a % diff, but I am getting blanks. Why is that?
From two tutorials I am trying two columns:
the diff2 column is
Diff2 = CALCULATE(
SUM([items.netRevenue]),FILTER(invoices_granular, invoices_granular[WeekNum]=MAX(invoices_granular[WeekNum])
- CALCULATE(
SUM(invoices_granular[items.netRevenue]),FILTER(invoices_granular,invoices_granular[WeekNum]=MIN(invoices_granular[WeekNum])
))
))
and Difference between Cat is:
Difference btw Cat =
IF (
HASONEVALUE(invoices_granular[WeekNum]),
BLANK(),
CALCULATE(
SUM(invoices_granular[items.netRevenue]),
FILTER(invoices_granular, invoices_granular[WeekNum] = MAX(invoices_granular[WeekNum]))
)
- CALCULATE(
SUM(invoices_granular[items.netRevenue]),
FILTER(invoices_granular,invoices_granular[WeekNum] = MIN(invoices_granular[WeekNum]))
)
)
@Anonymous , Make sure you have separate week or date table and then try approch like
Have these new columns in Date Table, Week Rank is Important in Date/Week Table
Week Rank = RANKX('Date','Date'[Week Start date],,ASC,Dense)
OR
Week Rank = RANKX('Date','Date'[Year Week],,ASC,Dense) //YYYYWW format
These measures can help
This Week = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])))
Last Week = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])-1))
Power BI — Week on Week and WTD
https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3
https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-Last-Week/ba-p/1051123
https://www.youtube.com/watch?v=pnAesWxYgJ8
Hi @amitchandak This is not exactly what I need I think.
I made a separate date table, and changed the formula and still I get blank values.
I want to calculate a difference for categories 0 as in screenshot, sales on 7/7/23 for category Messtechnik are 11k, and for category Werkzeuge are 4,9k. I want the difference to populate and show 6k. Instead I am getting blanks.
I followed tutorials and not sure what I missed
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
63 | |
63 | |
53 | |
39 | |
25 |
User | Count |
---|---|
85 | |
57 | |
45 | |
43 | |
38 |