Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
Hi If you see the screenshot I I filter one month from slicer and one employee from slicer it is showing 2 which is wrong. It should show one. Because the employee was present in that month. If I select 1 and 2 month from slicer it is showing 5 but it should show 2 for that particular since Alex is present in month 1 and month 2. If selected month is 1,2 and 3 then total count should show 3. the employee is present in all the 3 months. I need help on this how I can achieve using DAX. Thanks in advance. equirement.
Solved! Go to Solution.
Hi @_Junayetrahman , The data has denormalized architecture. In order to reach your target I can suggest 2 steps of Dax.
First step is creating calculated column which will be composite key for this dataset, meanly it is a primary key.
superkey= combinevalues(",",[EmployeeName],[Month]) --> this one become a PK for your dataset.
normally I prefer to create superkey by integer data types , but I saw your month and employeeName columns are both string. without converting datatype, you can directly create this composite key.
Then as a 2. step;
create measure :
month_availability= distinctcount(superkey)
if you user this "month_availability" measure in your graph, it will work.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @_Junayetrahman ,
Below is my table:
The following DAX might work for you:
Measure =
CALCULATE(
DISTINCTCOUNT('Table'[payroll Period]),
ALLEXCEPT('Table','Table'[Month])
)
The final output is shown in the following figure:
Best Regards,
Xianda Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @_Junayetrahman ,
Below is my table:
The following DAX might work for you:
Measure =
CALCULATE(
DISTINCTCOUNT('Table'[payroll Period]),
ALLEXCEPT('Table','Table'[Month])
)
The final output is shown in the following figure:
Best Regards,
Xianda Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @_Junayetrahman , The data has denormalized architecture. In order to reach your target I can suggest 2 steps of Dax.
First step is creating calculated column which will be composite key for this dataset, meanly it is a primary key.
superkey= combinevalues(",",[EmployeeName],[Month]) --> this one become a PK for your dataset.
normally I prefer to create superkey by integer data types , but I saw your month and employeeName columns are both string. without converting datatype, you can directly create this composite key.
Then as a 2. step;
create measure :
month_availability= distinctcount(superkey)
if you user this "month_availability" measure in your graph, it will work.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
111 | |
107 | |
106 | |
90 | |
61 |
User | Count |
---|---|
165 | |
136 | |
134 | |
97 | |
86 |