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
ignaciokairuz
Helper I
Helper I

Create Pivot Table using multiple date columns of Recycling Bin

Howdy Folks?
 
Lets make an example of a situation :  I have the Recycle bin on Windows where there are multiple date columns that represent different attributes : creation date / last modification date / deletion date.
 
Now lets modify this typicall example and suppose that in this directory we have both files that have been deleted and others that have not those that have not been deleted have a null value in the correspondent row of the deletion date column.
 
Given this case I'm trying to create a pivot table that in the first column displays the ratio of deleted files over created files for a given month.

ignaciokairuz_0-1642512278081.png

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@ignaciokairuz , You need created date column without time for these three column

 

example

DAX

Date = [datetime].date
or
Date = date(year([datetime]),month([datetime]),day([datetime]))

Power Query
DateTime.Date([datetime])

 

You need to join them with a common date column and two joins will be inactive, which you can activate using userelationship  in measure

https://radacad.com/userelationship-or-role-playing-dimension-dealing-with-inactive-relationships-in...

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@ignaciokairuz , You need created date column without time for these three column

 

example

DAX

Date = [datetime].date
or
Date = date(year([datetime]),month([datetime]),day([datetime]))

Power Query
DateTime.Date([datetime])

 

You need to join them with a common date column and two joins will be inactive, which you can activate using userelationship  in measure

https://radacad.com/userelationship-or-role-playing-dimension-dealing-with-inactive-relationships-in...

EDIT : Now I managed to understand! To those who , like me , can take a while to understand it, this is my way to paraphrase the solution : 

Create a separate table with all the dates used in the principal table. Create a relationship using using Power BI / Power Query / Power Pivot ( I used Power Pivot ) between each of the 3 columns and the separate date table (2 of those columns should be inactive by deselecting the checkbox at the bottom left side of the dialogue box when creating said relationship). Then create a measure using this formula

 

=DIVIDE(CALCULATE(COUNT(Tabla4_2[deleted]);USERELATIONSHIP(Tabla4_2[deleted];Tabla3[dates]));[Recuento de created])

 

Hope it's easy to understand!

 

Have a nice one!

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.