Forum Discussion
Pivot table as a source table
- 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
Hi MFelix
Thank you so much for your help. It is working and it's great. I made some changes to meet my data requerements. Here is the sample DAX:
# of CustomersX =
CALCULATE (
COUNTROWS (
FILTER (
SUMMARIZE ( Table, Table[CustomerID], "CountOfUsers", DISTINCTCOUNT(Table[CallsID]),
[CountOfUsers] = SELECTEDVALUE ( 'DistinctCount'[DistinctCount] )
)
)
)+0
I put +0 at the end to start the line from 0 on x-axis.
Thank you again.
Hi Anonymous ,
Good I could put you to the rigth track.
Regards,
MFelix