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
Vitaliy
Helper I
Helper I

How to calculate number of values which is not exist in table

Hi !

Please, help with this task:

I have 2 simple tables: Issue table and Metric table. In result mut be result table and bar chart like in screenshot.
Screenshot_3.jpg

Description:
1) Issue is SLA if fact time - plan time <= 0.
1.1) Also, issue can be without some metrics. In this case we thought that this is also SLA issue.
2) Otherwise - issue is Non-SLA.
How can I calculate number of issues in 1.1 and total number of SLA issues ?(

1 ACCEPTED SOLUTION
v-yuaj-msft
Community Support
Community Support

Hi @Vitaliy ,

 

Based on your description, you can create some measures as follows.

 

SLA Issue = calculate(count(Issue[Issue]), filter(Issue, (Issue[Face Time,h] - Issue[Plan Time,h]) <=0 ))+CALCULATE(DISTINCTCOUNT(Issue[Metric]))

 

SLA Non Issue =

var x1=calculate(count(Issue[Issue]), filter(Issue, (Issue[Face Time,h]- Issue[Plan Time,h]) >0))

return

IF(

    x1=BLANK(),0,x1)

 

Result:

v-yuaj-msft_0-1605520343604.png

 

Hope that's what you were looking for.

 

Best Regards,

Yuna

View solution in original post

3 REPLIES 3
v-yuaj-msft
Community Support
Community Support

Hi @Vitaliy ,

 

Based on your description, you can create some measures as follows.

 

SLA Issue = calculate(count(Issue[Issue]), filter(Issue, (Issue[Face Time,h] - Issue[Plan Time,h]) <=0 ))+CALCULATE(DISTINCTCOUNT(Issue[Metric]))

 

SLA Non Issue =

var x1=calculate(count(Issue[Issue]), filter(Issue, (Issue[Face Time,h]- Issue[Plan Time,h]) >0))

return

IF(

    x1=BLANK(),0,x1)

 

Result:

v-yuaj-msft_0-1605520343604.png

 

Hope that's what you were looking for.

 

Best Regards,

Yuna

amitchandak
Super User
Super User

@Vitaliy , Assume issue and Matrix table has many to one relationship, Try measures like

 

SLA Issue = calculate(count(Issue[Isssue]), filter(Issue, (Issue[fact time] - Issue[plan time]) <0 ))
SLA Non Issue = calculate(count(Issue[Isssue]), filter(Issue, (Issue[fact time] - Issue[plan time]) >=0 ))

 

@amitchandak 
This is not working as expected(
At first, I edited measures like this:
SLA Issue = calculate(count(Issue[Isssue]), filter(Issue, (Issue[fact time] - Issue[plan time]) <=0 ))
SLA Non Issue = calculate(count(Issue[Isssue]), filter(Issue, (Issue[fact time] - Issue[plan time]) >0 ))
And main thing that if I add this measures to bar chart or table I will not see result that I would expect. In result must be shown for every Issue and every metric is SLA issue in metric or not

Screenshot_6.jpg

 

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.