Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
72 | |
71 | |
57 | |
38 | |
36 |
User | Count |
---|---|
81 | |
67 | |
62 | |
46 | |
45 |