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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
NickCode
Regular Visitor

PowerBI Calculate and show in report the total number of occurrences for individual entries

Hello everyone,

 

First of all thank you for your support and consideration.

I am fairly new to PowerBI and I need to create a report that would show relevant information about the data.

The data which is coming in PowerBI is structured like this and also pasted some sample data:

Container  |  IssueName  |  IssueStatus  |  TimeCreated

Cont1        |  IssueX         |  OPEN           |   10/13/2021

Cont1        |  IssueY         |  OPEN           |   10/15/2021

Cont1        |  IssueA         |  CLOSED       |   10/15/2021

Cont2        |  IssueZ         |  OPEN           |   10/15/2021

Cont2        |  IssueB         |  CLOSED       |   10/17/2021

Cont3        |  IssueY         |  OPEN           |   10/15/2021

Cont3        |  IssueY         |  OPEN           |   10/15/2021

 

What I would like to do is to report for each container how many OPEN or CLOSED issues are present.

 

Can anyone please help with a suggestion how to accomplish this ?

 

Thank you,

Best regards,

Nick.

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@NickCode , with an independent date table to select date or month

 

Opened = calculate(distinctCOUNT('Table'[Container]), 'Table'[IssueStatus]="Open")
Closed calculate(distinctCOUNT('Table'[Container]), 'Table'[IssueStatus]="Closed")


Open not closed on a selected date =
var _max = maxx(allselected('Date1'), 'Date1'[Date])
return
calculate([Opened] - [Closed], filter('Table', 'Table'[TimeCreated] <= _max))

 

 

Month Opened =
var _max = maxx(allselected('Date1'), 'Date1'[Date])
var _min = maxx(allselected('Date1'), 'Date1'[Date])
return
calculate(distinctCOUNT('Table'[Container]), filter('table', 'Table'[Date] >=_min && 'Table'[Date] <=_max && 'Table'[IssueStatus]="Open"))

 

month closed =
var _max = maxx(allselected('Date1'), 'Date1'[Date])
var _min = maxx(allselected('Date1'), 'Date1'[Date])
return
calculate(distinctCOUNT('Table'[Container]), filter('table', 'Table'[Date] >=_min && 'Table'[Date] <=_max && 'Table'[IssueStatus]="Closed"))

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@NickCode , with an independent date table to select date or month

 

Opened = calculate(distinctCOUNT('Table'[Container]), 'Table'[IssueStatus]="Open")
Closed calculate(distinctCOUNT('Table'[Container]), 'Table'[IssueStatus]="Closed")


Open not closed on a selected date =
var _max = maxx(allselected('Date1'), 'Date1'[Date])
return
calculate([Opened] - [Closed], filter('Table', 'Table'[TimeCreated] <= _max))

 

 

Month Opened =
var _max = maxx(allselected('Date1'), 'Date1'[Date])
var _min = maxx(allselected('Date1'), 'Date1'[Date])
return
calculate(distinctCOUNT('Table'[Container]), filter('table', 'Table'[Date] >=_min && 'Table'[Date] <=_max && 'Table'[IssueStatus]="Open"))

 

month closed =
var _max = maxx(allselected('Date1'), 'Date1'[Date])
var _min = maxx(allselected('Date1'), 'Date1'[Date])
return
calculate(distinctCOUNT('Table'[Container]), filter('table', 'Table'[Date] >=_min && 'Table'[Date] <=_max && 'Table'[IssueStatus]="Closed"))

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.