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

Visual on 2 different dates in 1 single row

Hi Guys,

 

Below a simplified representation of the data i have. I have a long list of documents which have an 'opening date' and a 'closing' date. I want to have a chart showing me how many documents were open and closed in a specific month. I can't gat power BI to do this (tough it seems pretty straight forward).

 

I created a data table to be able to show the last 12 monts and tried to relate boths dates (opened / closed) to it.

 

The issue i'm having is that a document which is closed in feb for ex. but started in jan is still counted as 'closed' in jan.

 

image.pngimage.png

 

1 ACCEPTED SOLUTION

Here it is,

Create 2 Measures

Closed within Same Month = CALCULATE(COUNT(Data[DOC NR]),FILTER(Data,Data[DATE CLOSED]<=EOMONTH(Data[DATE OPEN],0)))

Open within Same Month = CALCULATE(COUNT(Data[DOC NR]),FILTER(Data,Data[DATE CLOSED]>EOMONTH(Data[DATE OPENED],0)))

 

PBI.JPG

 

 

View solution in original post

3 REPLIES 3
jthomson
Solution Sage
Solution Sage

It's probably a relationship issue - let's assume that the opened date is the one that has the active relationship to your date table, when you're wanting to count the number of closed dates, in your measure to do so you need to add in userelationship to tell Power BI to look at the relationship between your date table and your closed date column

I was thinking the same way. I am hower not that familliar yet with measures which count rows. Is there any working example available somewhere?

Here it is,

Create 2 Measures

Closed within Same Month = CALCULATE(COUNT(Data[DOC NR]),FILTER(Data,Data[DATE CLOSED]<=EOMONTH(Data[DATE OPEN],0)))

Open within Same Month = CALCULATE(COUNT(Data[DOC NR]),FILTER(Data,Data[DATE CLOSED]>EOMONTH(Data[DATE OPENED],0)))

 

PBI.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.