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
Dunner2020
Post Prodigy
Post Prodigy

Count of measure does not work

Hi there,

 

I have got a data of faliure euipment. I want to create a measure that returns the count of failure happens more than three times on the same location (i.e. Location code) and due to same cause in last 12 months. Here is how I wrote the measure:

 

Rolling_count =
Var _cause = MAX( 'Table'[Cause] )
Var _loc = MAX( 'Table'[LocID] )
var _count = CALCULATE(DISTINCTCOUNT('Table'[EventID]),FILTER('Table','Table'[LocID] ==_loc && 'Table'[Cause] == _cause), DATESINPERIOD('Date'[Date],MAX('Table'[Actual Event Start Time ]),-12,MONTH))
Return
IF(_count>3,_count)
 
I displayed the measure in table visual as shown below:
leo_89_0-1618457747169.png

I created another table visual to show the details of that event. For example, if I click the first row as shown in the picture

 
leo_89_1-1618457992140.png

The problem in above visual is that Cause number 23 only appears twice, it did not occur more than three times. So it should not be displayed in the list. Could anyone help me in  fixing the issue?

4 REPLIES 4
v-yuaj-msft
Community Support
Community Support

Hi @Dunner2020 ,

 

Could you please share some sample data and the expected result to have a clear understanding of your question? I can do some tests for you.

You can save your files in some cloud sharing platforms and share the link here.

How to provide sample data in the Power BI Forum - Microsoft Power BI Community

 

Best Regards,

Yuna

Dunner2020
Post Prodigy
Post Prodigy

@jdbuchanan71 , when I added rolling_count as measure in second visual and set to 'is not blank', it gone balnk as shown in the picture:

leo_89_0-1618460115070.png

 

Can you share you .pbix?  Load it to drop box or one drive and share the link.

jdbuchanan71
Super User
Super User

Try adding your Rolling_Count as a fitler on your second visual and set it to 'is not blank'

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.