We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hi guys,
I have a table, let's call it Table 1 where I've got columns A50 and Created On fields.
What do these fields mean?
What I want out of this table?
1) I want to create a measure that counts the number of transactions each customer made, I did by creating a measure Count_trans := COUNT('Table1'[A50]). Is this the best way?
2) What I also want to do is, see how many of these transactions were made last month by totally new customers.
I think there are two steps to this problem,
i) I created a measure called Trans_LM := CALCULATE( [Count_trans],
Hi @K_Zarar ,
Whether your problem has been solved? If yes, could you please mark the helpful post as Answered? It will help others easily to find the solution when they get the same issue.
Best Regards
Rena
Hi @Anonymous ,
You can create one measure as below:
NeworOldCustomer = var a=max('Table1'[A50 ]) var b=CALCULATE(COUNT('Table1'[A50 ]),filter('Table1',max('Table1'[A50 ])=a)) var c=LASTDATE('Table1'[Created On]) VAR d = CALCULATE(COUNT('Table1'[A50 ]),FILTER('Table1', 'Table1'[Created On] >= DATE ( YEAR ( c ), MONTH (c ) , 1) && 'Table1'[Created On] <= DATE ( YEAR ( c ), MONTH (c ) +1, 1) &&MAX('Table1'[A50 ])=a)) var f=DATE ( YEAR ( c ), MONTH (c ) - 1, 1) VAR e = if( d=b,"New Customer","Old Customer") return e |
Best Regards
Rena
To make time intelligence function work, make sure you have a date table.
See examples
MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
last MTD (complete) Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH(dateadd('Date'[Date],-1,MONTH))))
last year MTD (complete) Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH(dateadd('Date'[Date],-12,MONTH))))
last year MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-12,MONTH)))
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Proud to be a Datanaut Connect on Linkedin
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 54 | |
| 39 | |
| 32 | |
| 17 | |
| 15 |
| User | Count |
|---|---|
| 64 | |
| 63 | |
| 37 | |
| 36 | |
| 22 |