March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Dear Community Users ,
I have sales data in which Users generate purchase intent codes, like invoice numbers, and for each intent code sales are generated. A single user may generate multiple intent codes for sale, and approved intents are considered final sales.
Now, i have need to find YTD count of users who have only one purchase intent code and whose status is "Approved" and my FY starts from 1st april to 31 march.
User code, intent code, intent generated date, approval status are the columns in my data
I've tried this measure, but it doesn't work, giving me incorrect results
Please help me with this
Thanks
Solved! Go to Solution.
It looks like there are a few adjustments needed in your DAX formula to accurately calculate the year-to-date (YTD) count of users who have only one purchase intent code with an "Approved" status. The issue in your original formula is likely in the way the filter for single intent codes per user is applied.
1. First, ensure that the filter context for 'Approved' intents and within the correct fiscal YTD is correctly set.
2. We need to correctly filter users who have exactly one 'Approved' purchase intent in the YTD window.
Here’s how you can adjust your measure:
Unique Count YTD =
VAR ApprovedIntents =
FILTER(
CALCULATETABLE(
DISTINCT(Table[User Code]),
Table[Approval STATUS] = "Approved",
DATESYTD(Calendar_new[Date], "31/03")
),
CALCULATE(COUNTROWS(Table), Table[Approval STATUS] = "Approved") = 1
)
RETURN
COUNTROWS(ApprovedIntents)
- VAR ApprovedIntents: This variable creates a table of distinct 'User Code' that have 'Approved' status within the fiscal YTD.
- FILTER(...): Filters this table to keep only those users who have exactly one approved purchase intent code within the fiscal YTD.
- COUNTROWS(ApprovedIntents): Counts the number of unique user codes that meet the above criteria.
This approach ensures that the count is only considering users with exactly one approved intent code within the fiscal year to date, starting from April 1st.
Test this measure in your report to see if it produces the correct results. Adjustments might be necessary depending on how your calendar table aligns with the fiscal year and the specifics of your data model.
If this post helps, please consider Accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudo 👍
It looks like there are a few adjustments needed in your DAX formula to accurately calculate the year-to-date (YTD) count of users who have only one purchase intent code with an "Approved" status. The issue in your original formula is likely in the way the filter for single intent codes per user is applied.
1. First, ensure that the filter context for 'Approved' intents and within the correct fiscal YTD is correctly set.
2. We need to correctly filter users who have exactly one 'Approved' purchase intent in the YTD window.
Here’s how you can adjust your measure:
Unique Count YTD =
VAR ApprovedIntents =
FILTER(
CALCULATETABLE(
DISTINCT(Table[User Code]),
Table[Approval STATUS] = "Approved",
DATESYTD(Calendar_new[Date], "31/03")
),
CALCULATE(COUNTROWS(Table), Table[Approval STATUS] = "Approved") = 1
)
RETURN
COUNTROWS(ApprovedIntents)
- VAR ApprovedIntents: This variable creates a table of distinct 'User Code' that have 'Approved' status within the fiscal YTD.
- FILTER(...): Filters this table to keep only those users who have exactly one approved purchase intent code within the fiscal YTD.
- COUNTROWS(ApprovedIntents): Counts the number of unique user codes that meet the above criteria.
This approach ensures that the count is only considering users with exactly one approved intent code within the fiscal year to date, starting from April 1st.
Test this measure in your report to see if it produces the correct results. Adjustments might be necessary depending on how your calendar table aligns with the fiscal year and the specifics of your data model.
If this post helps, please consider Accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudo 👍
I appreciate your help. However, I have created a measure to find my exact value from the start of each FY to a selected date or month from the slicer.
#Unique Count YTD = CALCULATE([Unique Count YTD],DATESYTD(Calendar_new[Date],"31/03"))
Hello @735Alka ,
Try following Measure.
Thanks, it works for the mentioned start date and end date, but I need YTD count for example, if I choose a month or date from slicer, I need it to give the value up to that month or date from starting date of FY , i.e. I need a dynamic measure.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
119 | |
88 | |
73 | |
67 | |
49 |
User | Count |
---|---|
199 | |
141 | |
97 | |
79 | |
68 |