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 Team,
I need to perform a measure in Powerbi that compare dates and give me results (Expiry Status)
A. Expired Status; Compare todays date with Expiry date field and display Status
B. Close to Expiry; Compare todays date against a field (Number of days to expire) and display status (Close to Expirey /Okay Not expired)
Since this is perishable stock, there is a table with field that has entered with number of days to warn before expiry and this
is important to factor when building this measure.
thank you so much
Solved! Go to Solution.
I'm assuming that you've got some sort of relationship between your stock table and the table that holds your expiry warning cutoff times, one approach would be to:
- pull in the number of days that relates to that stock item as a variable
- use that number with TODAY() to work out when your warning date is
- make a nested if statement, seeing first if today's after the expiry date, then assigning a status of expired if it is, else seeing if today is after the warning date, then assigning a status of close to expired, otherwise not expired
I'm assuming that you've got some sort of relationship between your stock table and the table that holds your expiry warning cutoff times, one approach would be to:
- pull in the number of days that relates to that stock item as a variable
- use that number with TODAY() to work out when your warning date is
- make a nested if statement, seeing first if today's after the expiry date, then assigning a status of expired if it is, else seeing if today is after the warning date, then assigning a status of close to expired, otherwise not expired
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 |
---|---|
110 | |
94 | |
82 | |
66 | |
58 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |