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
tomb0
Frequent Visitor

Calculate Distintcount before it Does a filter from the date slicer

the issue im running into is that if i do this measure

amount of In Time =
CALCULATE(
    DISTINCTCOUNT('AMP'[Source Handling Unit]),
    'AMP'[delay/in time]="In time"
)
in a cluster column chart with a date slicer, it wil count the distinctcount per days so that means the same Value on monday and thueseday not what i want 

what im looking for is doing my measure before the Date slicer.

is this possible if so how.  
many thanks.
4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

Does this work?

amount of In Time =
CALCULATE(DISTINCTCOUNT('AMP'[Source Handling Unit]),'AMP'[delay/in time]="In time",all(Calendar[Date]))

Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Greg_Deckler
Super User
Super User

@tomb0 Try adding an ALLEXCEPT to your measure to remove the date filter.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

The thing i need.

Is this but then after the measure is done.

i want date filter to work again.
is this possible?

Hi @tomb0 ,

I'm not sure whether the following measure is what you want...

amount of In Time =
CALCULATE (
    DISTINCTCOUNT ( 'AMP'[Source Handling Unit] ),
    FILTER ( ALLSELECTED ( 'AMP' ), 'AMP'[delay/in time] = "In time" )
)

If the above one can't help you get your expected result, could you please share some sample data and your expected result with backend logic and specific examples in order to provide you a suitable solution? Thank you.

Best Regards

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

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.