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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
Anonymous
Not applicable

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
Anonymous
Not applicable

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 ))

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.