Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Anonymous
Not applicable

Distinct Count Total

Parameter was created and then used in a measure. The measure is: 

IF(Parameter[Parameter Value]<='fact AvailableTime'[Availability Percent],'fact AvailableTime'[Availability Percent])
 
Now that I can use this parameter whenever I adjust it higher/lower I can see the individuals with that availability percentage. The problem now is I need to incorporate another measure that shows individuals that are available vs. not available. The measure I thought I could use is:
IF([Parameter Value]<='fact AvailableTime'[Availability Percent with Parameter],DISTINCTCOUNT('fact AvailableTime'[Related Resource ID]))
 
This instead is giving me a total of resources (18) rather than 10 which is what the true result is based on my slicer adjustment. Ideas on how I can adjust my DAX calculation?
 
DistinctCount Incorrect.png
2 REPLIES 2
v-easonf-msft
Community Support
Community Support

Hi, @Anonymous 

You can create a new measure as follows:

 

New Count Resources = 
CALCULATE (
    DISTINCTCOUNT ( 'fact AvailableTime'[Related Resource ID] ),
    FILTER (
        'fact AvailableTime',
        Parameter[Parameter Value] <= 'fact AvailableTime'[Availability Percent with Parameter]
    )
)

 

11.png

Please check my sample file for more details.

 

Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

themistoklis
Community Champion
Community Champion

@Anonymous 

 

Try using tis formula:

IF([Parameter Value]<='fact AvailableTime'[Availability Percent with Parameter],SUMX (VALUES ( 'fact AvailableTime'[Sub Level] ), DISTINCTCOUNT('fact AvailableTime'[Related Resource ID])))

 

I have put 'fact AvailableTime'[Sub Level] in VALUES function as i cannot see if there is another dimension on the left of your table. Feel free to change the Sub Level field with lowest granularity field in the table

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.