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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
ssspk
Helper II
Helper II

What the error in the below Measure?

Hello Team,

 

What could be the reason for the below error in the Measure?

Do i need to create new Measure for ClickCount and Unique User? 

 

DAX:

_UniqueClicksPerDay_EventsPerUserPerDay =
SUMMARIZE(
    ADDCOLUMNS(
        GROUPBY(
            SUMMARIZE(
                'data',
                'data'[servertime],
                'data'[user],
                'data'[appid],
                "ClickCount", COUNTROWS('data')  -- Renamed to ClickCount
            ),
            'data'[servertime],
            'data'[appid]
        ),
        "ClicksCount", SUMX(CURRENTGROUP(), 'ClickCount'),
        "UniqueUsers", SUMX(CURRENTGROUP(), 1)
    ),
    'data'[servertime],
    'data'[appid],
    "UniqueClicks", [ClicksCount] / [UniqueUsers]
)
 
eventsperuser_perday.png
 
 
 
 
 
 
Thank you.
3 REPLIES 3
Kishore_KVN
Super User
Super User

Hello @ssspk ,

Reference given for SUMX is wrong because syntax of SUMX is as follows:

SUMX(<table>, <expression>)
So please correct it accordingly. Else explain your requirement with sample data and we will try to provide solution. 

 

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

Hello @Kishore_KVN ,

Thank you for your reply,

My Requirement is ,

Find 'Unique users per day'.

I have a

table name: data

column:servertime

column:user

column:appid

This is my python code,

events_per_user_per_day = all_events.groupby([pd.Grouper(key='servertime', freq='D', label='left'), 'user'])[['appId']].count()
f = events_per_user_per_day.groupby(level="servertime").size().plot()

How to convert this to DAX Query Measure?

 

Thanks 

Hello @ssspk ,

You can use below calcuation:

Unique Users Per Day = 
CALCULATE(
    DISTINCTCOUNT('data'[user]),
    ALLEXCEPT('data', 'data'[servertime])
)

 

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

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.