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

Measure Total Result display incorrect

Screenshot.jpg

I am having problem with the above coding. 

As shown above, i am having issue in fixing the Total value of the "Noofdays".

It is supposed to display 19 instead 57. 

Basically, I trying to to calculate the no of days whereby ES 2 is showing positive value.

Does anyone know what went wrong in my coding?

 

1 ACCEPTED SOLUTION

Hi,

This measure works

=COUNTROWS(FILTER(SUMMARIZE(VALUES(Resource[Date]),Resource[Date],"ABCD",[ES 2]),[ABCD]>0))

Hope this helps.

Untitled.png


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

View solution in original post

11 REPLIES 11
v-diye-msft
Community Support
Community Support

Hi @stoneage 

 

Try this one:

Measure 3 = CALCULATE(COUNTROWS('Resource'),FILTER('Resource',[ES 2]>0))
Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

Capture03.jpg

 

Thanks for your reply but issue the same. The filter does not work on the measure data.

 

Hi @stoneage 

 

Would you mind sharing your dummy pbix? I'd like to do further research and provide a solution.

 

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

@v-diye-msft 

Sorry for the late reply.

Yes, I can provide the dummy file. 

May I know how I can upload the pibx file?

Hi @stoneage 

 

You can upload it to dropbox/onedrive and share the link here.

 

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

@v-diye-msft  Below is the link to the file:

Power BI Dummy File 

Thanks.

Hi,

This measure works

=COUNTROWS(FILTER(SUMMARIZE(VALUES(Resource[Date]),Resource[Date],"ABCD",[ES 2]),[ABCD]>0))

Hope this helps.

Untitled.png


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

 @Ashish_Mathur  Thanks for your help. It works.

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
JirkaZ
Solution Specialist
Solution Specialist

@stoneage Why is your formula so complicated? Why can't you just use 
CALCULATE(COUNTROWS(Resource), [ES 2] > 0)

?

@JirkaZ Thanks for the reply.

Have done that as it will give error stating the "CALCULATE has been used in a True/Flase expression that is used as a table filter expression. This is not allowed".

I believed it is due to "ES 2" data is a measure value.

Additional information, only the "date" is raw data in column value while the "ES 2" and " Noofday" are calculated measure values.

The issue is that the rowcount can only accept table data but "ES 2"  is measure data.

Hence,  trying to create a virtual table using summerize  function to count it. But still cannot work. 


 

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.