The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Document | Date | Quarter |
Doc1 | 1/22/2023 | Q1-2023 |
Doc1 | 2/11/2023 | Q1-2023 |
Doc2 | 3/12/2023 | Q1-2023 |
Doc3 | 4/13/2023 | Q2-2023 |
Doc4 | 5/14/2023 | Q2-2023 |
Doc4 | 6/15/2023 | Q2-2023 |
Doc4 | 10/16/2023 | Q3-2023 |
Doc4 | 11/17/2023 | Q3-2023 |
Doc4 | 12/18/2023 | Q3-2023 |
Doc100 | 10/16/2022 | Q3-2022 |
Doc100 | 11/17/2022 | Q3-2022 |
Doc100 | 12/18/2022 | Q3-2022 |
Doc4545 | 12/18/2022 | Q3-2022 |
I have a quarter slicer selection and I dont have a date and to calculate the
KPI : no of unique docs from the year 2022 to selected quarter
Example: if I select the Q2-2023 on the slicer, then the no of unique documents to be calculated from 2022 to 2023
output is : 6
Please help me to write a dax ?
Solved! Go to Solution.
I think you might have done some mistake. Did you adjusted the measure to get the correct value of the slicer?
Here is the pbix.
If you still can't solve the issue, attach your pbix, I'll take a look
it is date type only but still does not show the right result, because whatever the quarter I select it gives the same output as 6, if I select Q3-2022 then it should give 2 but it gives 6 ,could you share your PBI file
Hello @Emerald70 ,
Measure =
Var _slicer = selectedvalue('Table'[Quarter])
var _maxdate= Calculate (max('Table'[Date]), 'Table'[Quarter] = _slicer, all('Table'))
return
calculate(DISTINCTCOUNT('Table'[Document]), 'Table'[Date]<=_maxdate, all('Table'))
Let me know if this help
The solution provided is not working
Why? I tested it and it works
You have to check if data column is date data type.
Also you asked to distinct count the documents, so to me it works as you asked. Let me know
User | Count |
---|---|
15 | |
13 | |
8 | |
6 | |
6 |
User | Count |
---|---|
24 | |
19 | |
12 | |
9 | |
7 |