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
andrew06074
Regular Visitor

Observed occurrences compared to total possible occurrences (date)

I have the following dataset

 

Screenshot 2023-03-13 140345.jpg

 

For each object I want to mark each date that the object had an observation so I can calculate its occurance ratio compared to time

 

For instance looking at 3/5-3/7 I would want the following table

 

Screenshot 2023-03-13 141450.jpg

Thank you! 

 

 

 

1 REPLY 1
v-yueyunzh-msft
Community Support
Community Support

Hi , @andrew06074 

According to your description, you want to generate a table from the dataset.

Here are the steps you can refer to :
(1)This is my test data:

vyueyunzhmsft_0-1678844713113.png

(2)We can click "New Table" and enter this:

Table 2 = ADDCOLUMNS( CROSSJOIN( CALENDAR(DATE(2023,3,5),DATE(2023,3,7)), VALUES('Table'[Object])) ,"Occurred" , 
var _t = FILTER('Table','Table'[Date] = EARLIER([Date]) && 'Table'[Object] =EARLIER('Table'[Object]))  return
IF( COUNTROWS(_t)>0 , "y","n"))

 

(3)The result is as follows:

vyueyunzhmsft_1-1678844743402.png

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

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.