Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
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
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
143 | |
85 | |
65 | |
51 | |
45 |
User | Count |
---|---|
218 | |
88 | |
83 | |
65 | |
56 |