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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Javi_Nofakes
Frequent Visitor

Count users by min value in column grouping by type filtering by date

Hi everyone,

Thanks in advance for your answers. I've been trying to figure out the solution looking into the forum and other source and finally I have had to post the question hear.

I would like to get the number of users by type and month. For that, I've created a column with a rank of the sessions by the column event_ts in order by get the min rank of the rows filtered by date but without success.

 

# user by type = 
VAR min_user_type_row = 
CALCULATE(
    MIN('FACT - Analytics users'[row_num]),
    ALLSELECTED('FACT - Analytics users'[ga_session_id])
)
return
CALCULATE(
    DISTINCTCOUNT('FACT - Analytics users'[ga_session_id]),
    'FACT - Analytics users'[row_num] = min_user_type_row
)

 

 

This is a set of the original data.

Screenshot 2023-01-08 at 21.16.11.pngScreenshot 2023-01-08 at 21.16.25.png 
And this one the result wanted.

 

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

Your question is not clear.  Why are you creating the row_num column?  Why are you taking the minimum of that column?  Share some data, describe the question and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thanks for your answer. Absolutely my explanation was not good at all, sorry. What I want to get is the number of users by "user_type" with the min "event_ts" in the range of dates selected. I think the screenshot above is clear to see the result after the new explanation, if not tell me and I can upload an pbix file. Thanks.

I just do not undestand.  Share an MS Excel file with the data and the expected result shown there.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
FreemanZ
Super User
Super User

hi @Javi_Nofakes 

without writing any measure, if you feed event_date (month), user_type, user_pseudo_id (distinct count) to a table visual, you shall get what you expect, or?

Thanks for your answer. It is not exactly what I need. What I want to get is the number of users by "user_type" with the min "event_ts" in the range of dates selected. Thanks.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.