Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Pivot table as a source table

Hello,   I am new to the DAX and will need some support by you. The problem I want to solve is described on the picture attached. Thank you in advance.
  • MFelix's avatar
    MFelix
    7 years ago

    Hi Anonymous ,

     

    Create the following table:

     DistinctCount = GENERATESERIES(0; 200; 1)

    The second argument can be change to the maximum value you  want, it doesnt matter the number since the next measure will filter out this table.

     

    Create the following measure:

    User Count histogram=
    CALCULATE (
        COUNTROWS (
            FILTER (
                SUMMARIZE ( Table1; Table1[Users]; "CountOfUsers"; COUNT ( Table1[Users] ) );
                [CountOfUsers] = SELECTEDVALUE ( 'DistinctCount'[DistinctCount] )
            )
        )
    )

    Now use the column of DistinctCount  table on your X-Axis and the measure on your values this will allow you to have slicers on dates and on users.

     

    Be aware that you can define if the values without data are viewed in the X-Axis changing from categorical to continuous on the options of the visual

     

    Check PBIX file attach.

     

    This solution is based on this blog post from PowerPivot(Pro).

     

    Regards,

    MFelix