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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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