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.
Dear all!
I have a database with multiple columns, which for my issue only 3 are relevant:
- Reference document number
- Date
- Quantities sold.
I want to be able to write a DAX formulas that would count the MTD distinct counts of reference document number for which quantities are positive (i.e. it's not a refund).
I started with this formula:
thanks in advance for the help!!
Solved! Go to Solution.
Hi @lin_charlotte ,
Test the below:
Transactions_CY_MTD =
TOTALMTD (
CALCULATE (
DISTINCTCOUNT ( 'KE31'[Reference document] ),
FILTER ( KE31,[quantities] >0 )
),
'Date Table'[Date]
)
Output result:
If not incorrect ,could you pls show me what output you want?
Best Regards
Lucien
Hi @lin_charlotte ,
Test the below:
Transactions_CY_MTD =
TOTALMTD (
CALCULATE (
DISTINCTCOUNT ( 'KE31'[Reference document] ),
FILTER ( KE31,[quantities] >0 )
),
'Date Table'[Date]
)
Output result:
If not incorrect ,could you pls show me what output you want?
Best Regards
Lucien
Thanks! it worked 🙂
You are trying to do a MTD calculation but your sample data only has single values for each month. That is not sufficient to do MTD calculations.
Please provide sanitized sample data that fully covers your issue. Paste the data into a table in your post or use one of the file services. Please show the expected outcome.
Hi Ibendlin,
Thanks for answering,
My dataset looks like this (I don't seem to be able to add an attachment) - i have daily postings of quantities, by Customer with a reference document. I would like to have the distinct count of reference documents for which the quantity is positive (i.e. not a refund), by period (hence the MTD), so that i can then replicate the MTD Distinct Count to Last Year MTD Distinct Count and Last Last Year Distinct Count.
Thanks for the help!
Posting date | Customer | Reel SALES QTIES ALL PROD | Reference document |
1/2/2019 | A | 1 | 770782093 |
1/2/2019 | A | 1 | 770782028 |
1/2/2019 | A | 1 | 770782087 |
1/2/2019 | A | 1 | 770782062 |
1/2/2019 | A | 1 | 770782025 |
1/2/2019 | A | 1 | 770782026 |
1/2/2019 | A | 1 | 770782063 |
1/2/2019 | A | 1 | 770782022 |
1/2/2019 | A | 1 | 770782047 |
1/2/2019 | A | 1 | 770782046 |
1/2/2019 | A | 1 | 770782023 |
1/2/2019 | A | 1 | 770782045 |
1/2/2019 | A | 1 | 770782027 |
1/2/2019 | A | -1 | 770782030 |
1/2/2019 | A | 1 | 770782090 |
1/2/2019 | A | -1 | 770782070 |
1/2/2019 | A | 1 | 770782091 |
1/2/2019 | A | 1 | 770782092 |
1/2/2019 | A | 1 | 770782021 |
1/2/2019 | A | 1 | 770782073 |
1/2/2019 | A | -1 | 770782057 |
1/2/2019 | A | 1 | 770782064 |
1/2/2019 | A | -1 | 770782056 |
1/2/2019 | A | 1 | 770782024 |
1/2/2019 | A | -1 | 770782029 |
1/2/2019 | A | 1 | 770782093 |
1/2/2019 | A | 1 | 770782089 |
1/2/2019 | A | -1 | 770782069 |
1/2/2019 | A | 1 | 770782093 |
1/2/2019 | A | 1 | 770782088 |
1/2/2019 | D | 1 | 770782016 |
1/2/2019 | D | 1 | 770782059 |
1/2/2019 | D | 1 | 770782018 |
1/2/2019 | D | 1 | 770782059 |
1/2/2019 | D | 1 | 770782015 |
1/2/2019 | D | 1 | 770782017 |
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 |
---|---|
111 | |
95 | |
77 | |
68 | |
54 |
User | Count |
---|---|
144 | |
105 | |
102 | |
89 | |
63 |