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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
ahpatil11
New Member

How to create new and repeated users

Hi All,

This is my first Question. Please help me

I wanted to have New and Repeated User for my data and also total transaction done for new and repeated user. The thing is that I had joined 2 tables (on USER_REFERENCE_NUMBER) to get below table

USER_CREATION_DATE and USER_REFERENCE_NUMBER are from Customer table and TRANSACTION_CREATED_AT and TXN_AMOUNT are from transaction table

Please provide me the solution. 

ahpatil11_0-1673543964487.png

 

1 ACCEPTED SOLUTION

hi @ahpatil11 

then try:

TransactionNew =
VAR _list1=
CALCULATETABLE(
     VALUES(TableName[UserNumber]),      
     YEAR(TableName[UserCreationDate])=YEAR(TODAY()),
     MONTH(TableName[UserCreationDate])=MONTH(TODAY())
)
VAR _list2=
CALCULATETABLE(
     VALUES(TableName[UserNumber]),
     YEAR(TableName[UserCreationDate])=YEAR(TODAY()),
    MONTH(TableName[UserCreationDate])=MONTH(TODAY())-1
)
VAR _new =
EXCEPT(_list1,_list2)
RETURN
CALCULATE(
     SUM(TableName[Amount]),
     _new
)

TransactionRepeat =
CALCULATETABLE(
     VALUES(TableName[UserNumber]),      
     YEAR(TableName[UserCreationDate])=YEAR(TODAY()),
     MONTH(TableName[UserCreationDate])=MONTH(TODAY())
)
VAR _list2=
CALCULATETABLE(
     VALUES(TableName[UserNumber]),
     YEAR(TableName[UserCreationDate])=YEAR(TODAY()),
    MONTH(TableName[UserCreationDate])=MONTH(TODAY())-1
)
VAR _repeat =
INTERSECT(_listthisyear, _listlastyear)
RETURN
CALCULATE(
     SUM(TableName[Amount]),
    _repeat
)

 

in case of issue, please conside post the sample data as text in the reply.

View solution in original post

4 REPLIES 4
ahpatil11
New Member

Hi @FreemanZ 

Thank you for the solution. It Works

FreemanZ
Community Champion
Community Champion

hi @ahpatil11 

 
depends on how do you define new and repeat. typically it is in year, if so, you may try to write two measures like:
 
TransactionNew =
VAR _listthisyear=
CALCULATETABLE(
     VALUES(TableName[UserNumber]),      YEAR(TableName[UserCreationDate])=YEAR(TODAY())
)
VAR _listlastyear = 
CALCULATETABLE(
     VALUES(TableName[UserNumber]), 
     YEAR(TableName[UserCreationDate])=YEAR(TODAY())-1
)
VAR _new = 
EXCEPT(_listthisyear, _listlastyear)
RETURN
CALCULATE(
     SUM(TableName[Amount]), 
     _new
)
 
TransactionRepeat =
VAR _listthisyear=
CALCULATETABLE(
VALUES(TableName[UserNumber]), YEAR(TableName[UserCreationDate])=YEAR(TODAY())
)
VAR _listlastyear =
CALCULATETABLE(
     VALUES(TableName[UserNumber]),
YEAR(TableName[UserCreationDate])=YEAR(TODAY())-1
)
VAR _repeat =
INTERSECT(_listthisyear, _listlastyear)
RETURN
CALCULATE(
     SUM(TableName[Amount]),
    _repeat
)

Hi @FreemanZ 

Thank you for your reply 

I wanted to show total transactions done in months by new and repeated users. 

I tried your solution but it is coming has blank

 

can you help me with this

hi @ahpatil11 

then try:

TransactionNew =
VAR _list1=
CALCULATETABLE(
     VALUES(TableName[UserNumber]),      
     YEAR(TableName[UserCreationDate])=YEAR(TODAY()),
     MONTH(TableName[UserCreationDate])=MONTH(TODAY())
)
VAR _list2=
CALCULATETABLE(
     VALUES(TableName[UserNumber]),
     YEAR(TableName[UserCreationDate])=YEAR(TODAY()),
    MONTH(TableName[UserCreationDate])=MONTH(TODAY())-1
)
VAR _new =
EXCEPT(_list1,_list2)
RETURN
CALCULATE(
     SUM(TableName[Amount]),
     _new
)

TransactionRepeat =
CALCULATETABLE(
     VALUES(TableName[UserNumber]),      
     YEAR(TableName[UserCreationDate])=YEAR(TODAY()),
     MONTH(TableName[UserCreationDate])=MONTH(TODAY())
)
VAR _list2=
CALCULATETABLE(
     VALUES(TableName[UserNumber]),
     YEAR(TableName[UserCreationDate])=YEAR(TODAY()),
    MONTH(TableName[UserCreationDate])=MONTH(TODAY())-1
)
VAR _repeat =
INTERSECT(_listthisyear, _listlastyear)
RETURN
CALCULATE(
     SUM(TableName[Amount]),
    _repeat
)

 

in case of issue, please conside post the sample data as text in the reply.

Helpful resources

Announcements
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.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.

March Power BI Update Carousel

Power BI Community Update - March 2026

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