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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
eapo12
Regular Visitor

Help on Calculation

Hello guys!

Anyone would be able to help me on the following 2 queries that I am stuck in. I have tried few different things but no success. I am trying to do up a graphs for some specific scenarios.
I have different csv files for different rounds, Round 1, Round 2, Round 3 and so on. In every file I have a Round and AccountID column, Account ID is unique across them. Structure example is at the bottom below.
My difficulties are:
1. I want to do up a graph where will show the number of users who played the the current round but also played the last 3, for example, users who played the Round 4 but also played the Round 1, 2 and 3;
2. My second query is, I would like to show a graph where it shows the Total number of users in a round and also to show the Number of NEW USERS. For example, who is a New User on Round 4 who was not in Round 1, 2 and 3.

csv. files structure example:
Round | AccountID
1         | 256981
1         | 563952
1         | 585223
1         | 112598

Round | AccountID
2         | 115698
2         | 598652
2         | 256981
2         | 112598

Really appreciate any help!! Thank you!

3 REPLIES 3
Mohammad_Refaei
Solution Specialist
Solution Specialist

Please share the full data structure

Hi there, thank you for the reply!
Structure as below (The data will have over 10k rows).

eapo12_1-1628071723800.pngeapo12_2-1628071763824.pngeapo12_3-1628071787355.pngeapo12_4-1628072011732.png

 

 



You may create 2 measures as follows:

 

All Rounds Players =
IF (
    CALCULATE ( COUNTROWS ( Data ), ALLEXCEPT ( Data, Data[Username] ) ) = 4,
    "AllRoundsPlayer"
)
Count of New Players = 
COUNTROWS (
    FILTER (
        ADDCOLUMNS (
            SUMMARIZE ( Data, Data[Username] ),
            "ROUND4", CALCULATE ( COUNTROWS ( Data ), Data[Round] = 4 ),
            "AllRounds", CALCULATE ( COUNTROWS ( Data ) )
        ),
        [AllRounds] = 1
            && [ROUND4] = 1
    )
)

 

You may check this sample file.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors