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.
Hi Power BI Masters,
Here i have one question which i need using dax,
I need the product status which is changed or not changed for last n Number of days.
For Example if the product A having status constant for last 60 days then it moved to not changed category or if product A status changed to then it moved to changed category. PLease provide the formula using DAX.
Attaching Powerbi Pbix file in this link :
sample report.pbix - Google Drive
Appriciated for quick response Advance thanks
Thanks
sandeep
Solved! Go to Solution.
Hi, @avulasandeep
You may try the following measure.
Result =
var _category = SELECTEDVALUE(Sheet1[Category])
var result =
CALCULATE(
DISTINCTCOUNT(Sheet1[Status]),
FILTER(
ALL(Sheet1),
[Category]=_category&&
[Date]<=TODAY()&&
[Date]>=TODAY()-59
)
)
return
IF(
result>1,
"Changed",
"Not Changed"
)
Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @avulasandeep
You may try the following measure.
Result =
var _category = SELECTEDVALUE(Sheet1[Category])
var result =
CALCULATE(
DISTINCTCOUNT(Sheet1[Status]),
FILTER(
ALL(Sheet1),
[Category]=_category&&
[Date]<=TODAY()&&
[Date]>=TODAY()-59
)
)
return
IF(
result>1,
"Changed",
"Not Changed"
)
Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@avulasandeep
Add this as a new column to your table:
Status Change M =
VAR __STATTUS = [Status]
VAR _CAT = [Category]
VAR _DATE = [Date]
VAR _FOUND =
COUNTROWS(
FILTER(
Sheet1,
Sheet1[Category]<>_CAT && Sheet1[Date] < _DATE && Sheet1[Date] >= (_DATE - 60)
)
)
RETURN
IF( _FOUND > 0, "Changed" , "Not Changed")
________________________
If my answer was helpful, please consider Accept it as the solution to help the other members find it
Click on the Thumbs-Up icon if you like this reply 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
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 |
---|---|
109 | |
99 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
87 | |
64 |