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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
mgr13
Regular Visitor

YTD of results of monthly unique user count

Hi
I have a situation
Table name : app_interaction
Columns: appname, activity, userid, created_on(date)

Now I want to bulid the table visual with year, month, distinct count(userid) as count of unique IDs , and next I want I want calculate the total YTD of unique user IDs,

Here while calculating
If Jan has 12 unique users and Feb has 10 unique

So YTD I need is 32 because I have the monthly cost/user to be multiplied to the value 32

The problem is it's giving me the less than the 32. As it's removing the number of common users in two months

 

Can someone please help me to do this

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @mgr13 

You can refer to the following measure

Sample data 

vxinruzhumsft_0-1690269979263.png

 

Measure

Measure = var a=SUMMARIZE(ALLSELECTED(app_interaction),app_interaction[created_on].[Year],app_interaction[created_on].[MonthNo],"Distinct",CALCULATE(DISTINCTCOUNT(app_interaction[userid])))
return IF(DISTINCTCOUNT(app_interaction[userid])<>BLANK(),SUMX(FILTER(a,[created_on].[Year] in VALUES(app_interaction[created_on].[Year])&&[created_on].[MonthNo]<=SELECTEDVALUE(app_interaction[created_on].[MonthNo])),[Distinct]))

Output

vxinruzhumsft_1-1690270038690.png

 

Best Regards!

Yolo Zhu

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

5 REPLIES 5
mgr13
Regular Visitor

Hi @Anonymous 

 

Thanks for your support.

I have a question

For the above data 

I had to calculate the past 90 day unique users for every month and the next colum I need to do the YTD of the above in a table visual.

 

 

Thanks

Guru

mgr13
Regular Visitor

Any one please help me out for this

Manoj_Nair
Solution Supplier
Solution Supplier

@mgr13- Check this out, let me know if this works.

YTD Unique User IDs = 
    CALCULATE(
        DISTINCTCOUNT('app_interaction'[userid]),
        CALCULATETABLE(
            VALUES('app_interaction'[userid]),
            DATESYTD('app_interaction'[created_on])
        )
    )

I've hypothetically established this DAX measure, but without much clarity regarding your datasets. If this doesn't serve your needs, I recommend you share a sample dataset. This will give me a more comprehensive understanding of your data structure, enabling me to devise a more suitable solution. Cheers

Thanks for sharing ur insignt @Manoj_Nair 

 

I have tried the dax code that you have given  but it's giving the same as unique user IDs

1690185340628788311193225551255.jpg

 but what I need is the Excel image I  shown

16901854803335543975691978791455.jpg

 here I am providing the pic of a data sample

16901855212427644038125182579595.jpg

 could you refer thes information and provide me some guidance if possible

Thanks

Anonymous
Not applicable

Hi @mgr13 

You can refer to the following measure

Sample data 

vxinruzhumsft_0-1690269979263.png

 

Measure

Measure = var a=SUMMARIZE(ALLSELECTED(app_interaction),app_interaction[created_on].[Year],app_interaction[created_on].[MonthNo],"Distinct",CALCULATE(DISTINCTCOUNT(app_interaction[userid])))
return IF(DISTINCTCOUNT(app_interaction[userid])<>BLANK(),SUMX(FILTER(a,[created_on].[Year] in VALUES(app_interaction[created_on].[Year])&&[created_on].[MonthNo]<=SELECTEDVALUE(app_interaction[created_on].[MonthNo])),[Distinct]))

Output

vxinruzhumsft_1-1690270038690.png

 

Best Regards!

Yolo Zhu

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

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.