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
mathician
Helper II
Helper II

Email opening vs email sent, on a line chart

I have 1 table with the data under. And i want to create a line chart that shows, date and how much sent vs opened. Both of them have their own datetime. So i want to se how much that where sent today vs opened. If i select one of the date it gets messy, it will group by the days that it was sent.

 

SendtSendt_dtOpenedOpened_dt
12015-03-06 11:49:57.75012015-04-06 11:49:57.750
9 REPLIES 9
amitchandak
Super User
Super User

@mathician ,

 

send Date = [Sendt_dt].date
Open Date = [Opened_dt].date

Join both these dates with date table and one will inactive realtion. Use the inactive one in measure using userelation

 

Example

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

Greg_Deckler
Super User
Super User

@mathician Seems like you would need a disconnected date table and then you could do something like:

Measure Sent = 
  VAR __Date = MAX('Date'[Date])
RETURN
 COUNTROWS('Table',DATE(YEAR('Table'[SendtSendt_dt]),MONTH('Table'[SendtSendt_dt]),DAY('Table'[SendtSendt_dt])) = __Date)

Measure Opened = 
  VAR __Date = MAX('Date'[Date])
RETURN
 COUNTROWS('Table',DATE(YEAR('Table'[OpenedOpened_dt]),MONTH('Table'[OpenedOpened_dt]),DAY('Table'[OpenedOpened_dt])) = __Date)

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

How do i use my date coloumns, since powerbi just lets me use measure in this situation. Just i explained above.

Dosent seem like to work. When i add my table name and column name in "the place that i marked red" only measure coulmns apear, i dont get the options to add my date coulmns.

 

MAX('Date'[Date]) RETURN COUNTROWS('Table',DATE(YEAR('Table'[SendtSendt_dt]),

 

hi  @mathician 

Just miss a "FILTER" in the formula

 

Measure Sent = 
  VAR __Date = MAX('Date'[Date])
RETURN
 COUNTROWS(FILTER('Table',DATE(YEAR('Table'[SendtSendt_dt]),MONTH('Table'[SendtSendt_dt]),DAY('Table'[SendtSendt_dt])) = __Date))

Measure Opened = 
  VAR __Date = MAX('Date'[Date])
RETURN
 COUNTROWS(FILTER('Table',DATE(YEAR('Table'[OpenedOpened_dt]),MONTH('Table'[OpenedOpened_dt]),DAY('Table'[OpenedOpened_dt])) = __Date))

 

 

Measure Opened =
VAR __Date = MAX('Date'[Date])
RETURN
COUNTROWS(FILTER('Table',DATE(YEAR('Table'[OpenedOpened_dt]),MONTH('Table'[OpenedOpened_dt]),DAY('Table'[OpenedOpened_dt])) = __Date))

 

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

My date table is a normal CalenderAuto table. But my fact table has the value bellow "2020-09-09 22:32:57.000"

 

What coulmns should my datetable have? for it to be joinable. Because its not joining right now.

hi  @mathician 

This work on my side, here is sample pbix file, please try it.

 

and could you please share your sample pbix file and expected output, that will be a great help.

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Returns Null on both values.

vanessafvg
Super User
Super User

what are you struggling with exactly?
in time analysis you need to create a date table. You can do this with calendarauto() or similar (as long as you dont have odd dates like 2999-99-99 otherwise it will create large tables.
you need to either create a role playing dimension or use both active and inactive relationships.

i would create a date table
link both of your dates to that table date
the relatioship with a dotted line is your inactive relationship, you can use the function userelationship() to get the measures with that date.

this will give yo umore information https://docs.microsoft.com/en-us/power-bi/guidance/relationships-active-inactive

https://www.youtube.com/watch?v=u8_aeLmXbVk




If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




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.