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

Get Fabric Certified for FREE during AI Skills Fest. This week only. Secure your voucher now.

Reply
Jokiamu
Regular Visitor

Filter data of different date column

Hello, 

I wanted to make a report in PowerBI but i not success. I want extract how many item was created and closed by month or year.

 

Here an example of my data : 

 

NameCreatedDateClosedDate

Item1

01/01/2021 
Item201/01/202201/02/2022
Item301/02/2022 
Item401/07/202101/10/2021

 

I would like to have chart bar to know how many item was created in 2021 for example and how many item was closed.

 

Sans titre.png

 

I want to count how many item had CreatedDate if Date match to my filter date (By year or month). and do the same for closed date.

 

It's easy with 2 separated chart but i need to do it in 1 graph. 

 

I search alternative with "Merge chart" but i failed 😄

 

Thanks

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Jokiamu ,

 

  • Method1 : Create a Calendar table firstly:
Calendar = CALENDAR(MIN('Table'[CreatedDate]),MAX('Table'[ClosedDate])) 

Then create measures:

Created = CALCULATE(COUNTROWS('Table'),FILTER('Table',YEAR([CreatedDate])=YEAR(MAX('Calendar'[Date])) &&MONTH([CreatedDate])=MONTH(MAX('Calendar'[Date])) ))
Closed = CALCULATE(COUNTROWS('Table'),FILTER('Table',YEAR([ClosedDate])=YEAR(MAX('Calendar'[Date])) &&MONTH([ClosedDate])=MONTH(MAX('Calendar'[Date])) ))

Eyelyn9_0-1652667063686.png

 

 

  • Method2 : Or you could unpivot the table in Power Query:

Eyelyn9_1-1652667149152.png

Output:

Eyelyn9_2-1652667222403.png

 

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

View solution in original post

2 REPLIES 2
Jokiamu
Regular Visitor

Thanks that's help a lot. 1 calendar table sounds to be the solution. 

 

I will use method 1. Thanks

Anonymous
Not applicable

Hi @Jokiamu ,

 

  • Method1 : Create a Calendar table firstly:
Calendar = CALENDAR(MIN('Table'[CreatedDate]),MAX('Table'[ClosedDate])) 

Then create measures:

Created = CALCULATE(COUNTROWS('Table'),FILTER('Table',YEAR([CreatedDate])=YEAR(MAX('Calendar'[Date])) &&MONTH([CreatedDate])=MONTH(MAX('Calendar'[Date])) ))
Closed = CALCULATE(COUNTROWS('Table'),FILTER('Table',YEAR([ClosedDate])=YEAR(MAX('Calendar'[Date])) &&MONTH([ClosedDate])=MONTH(MAX('Calendar'[Date])) ))

Eyelyn9_0-1652667063686.png

 

 

  • Method2 : Or you could unpivot the table in Power Query:

Eyelyn9_1-1652667149152.png

Output:

Eyelyn9_2-1652667222403.png

 

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

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.