Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello guys!
I have a table called "OPEN POs" that looks like this:
WeekNum | Supplier | PO number | Payment term |
33 | A | 158 | 30 days |
33 | C | 105 | 60 days |
33 | Y | 469 | 30 days |
33 | A | 422 | 90 days |
33 | Y | 789 | 75 days |
33 | U | 156 | 120 days |
33 | Y | 111 | 45 days |
34 | A | 158 | 60 days |
34 | C | 105 | 60 days |
34 | T | 88 | 90 days |
34 | Z | 156 | 120 days |
34 | U | 777 | 120 days |
34 | B | 879 | 45 days |
34 | Y | 789 | 45 days |
34 | U | 156 | 120 days |
I'm trying to build a matrix like this:
Week 34 | PO number | Supplier | From | To |
158 | A | 30 days | 60 days | |
789 | Y | 75 days | 45 days |
The idea is to show the "PO numbers" that had its "Payment term" changed from one week to another.
The variation always needs to be from the current week (that will be selected on the slicer) versus the previous week.
Can you guys please help me on this one?
@mahoneypat ideas? 😁 😬
Thank you for the support! 🙂
Solved! Go to Solution.
What should happen in week number 1 ?
Anyway. Add two calculated columns (measures are not required here as there is no filter impact)
Last Week =
var p='OPEN POs'[PO number]
var s='OPEN POs'[Supplier]
var w='OPEN POs'[WeekNum]
return calculate(max('OPEN POs'[Payment term]),all('OPEN POs'),'OPEN POs'[PO number]=p,'OPEN POs'[Supplier]=s,'OPEN POs'[WeekNum]=w-1)
Different = SWITCH(TRUE(),ISBLANK('OPEN POs'[Last Week]),"no",[Last Week]='OPEN POs'[Payment term],"no","yes")
Then filter your table to Different="yes"
@Anonymous , refer my blog on Week over a week using week rank. But for that, you need a week and year. In case you only have a week. You can use week in place of week rank.
Power BI — 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
Please try these two expressions for From and To. They seem to get your desired result.
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
What should happen in week number 1 ?
Anyway. Add two calculated columns (measures are not required here as there is no filter impact)
Last Week =
var p='OPEN POs'[PO number]
var s='OPEN POs'[Supplier]
var w='OPEN POs'[WeekNum]
return calculate(max('OPEN POs'[Payment term]),all('OPEN POs'),'OPEN POs'[PO number]=p,'OPEN POs'[Supplier]=s,'OPEN POs'[WeekNum]=w-1)
Different = SWITCH(TRUE(),ISBLANK('OPEN POs'[Last Week]),"no",[Last Week]='OPEN POs'[Payment term],"no","yes")
Then filter your table to Different="yes"
Let me try this solution..
btw, week number one can be null.. no reference to bring any variance.
that's not what I meant. Is your report limited to a single year? Or would you expect week 1 look back at week 52 of the prior year etc?
good catch.. at some point i'll have the same week for a subsequent year
@Anonymous - You should be able to borrow the concept from MTBF. See my article on Mean Time Between Failure (MTBF) which uses EARLIER: http://community.powerbi.com/t5/Community-Blog/Mean-Time-Between-Failure-MTBF-and-Power-BI/ba-p/339586
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
47 | |
26 | |
19 | |
14 | |
10 |
User | Count |
---|---|
58 | |
50 | |
44 | |
19 | |
19 |