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
cduggan
Regular Visitor

Creating chart for Count by Count of Count

Hello I have been struggling to create a chart the way I wanted to for a while now and thought I would ask for help as I can't find any concrete answers.

I have a table formatted as follows

DateNameValidPrice
1/1/2023JohnYes$1
1/1/2023JohnNo$4
1/1/2023JaneYes$1
1/2/2023JohnYes$3
1/2/2023GaryNo$2

The chart I am looking to display has two slicers that need to apply to it, Date and Valid (I have already created a calendar table and linked it appropriately).

What I am looking to display is a histgram that shows:

X-Axis: The summed price

Y-Axis: The number of Names that had a summed price of x in the selected date range on the Y axis

 

So in this example

Date Range: 1/1/2023-1/1/2023, Valid: Yes

Expect bar of height 2 at price 1 because there are two people who have a total price of 1 in that range of time

 

Date Range: 1/1/2023-1/2/2023, Valid: No

Expect to see a bar of height 1 at price 2 and 4.

 

Date Range: 1/1/2023-1/2/2023, Valid: Yes or No

Expect bar of height 1 at price 8, 2, and 1

etc

1 ACCEPTED SOLUTION
v-jianboli-msft
Community Support
Community Support

Hi @cduggan ,

 

Please try:

First create a new table for x-axis:

Summed Price = GENERATESERIES(MIN('Table'[Price]),SUM('Table'[Price]))

vjianbolimsft_0-1685588746487.png

Then apply the measure to the chart:

Measure = 
var _a = SUMMARIZE('Table','Table'[Name],"Price",SUM('Table'[Price]))
return CALCULATE(COUNT('Table'[Name]),FILTER(_a,[Price]=SELECTEDVALUE('Summed Price'[Price])))

vjianbolimsft_1-1685588801583.png

Final output:

vjianbolimsft_2-1685588838819.png

vjianbolimsft_3-1685588853719.png

Best Regards,

Jianbo Li

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

View solution in original post

1 REPLY 1
v-jianboli-msft
Community Support
Community Support

Hi @cduggan ,

 

Please try:

First create a new table for x-axis:

Summed Price = GENERATESERIES(MIN('Table'[Price]),SUM('Table'[Price]))

vjianbolimsft_0-1685588746487.png

Then apply the measure to the chart:

Measure = 
var _a = SUMMARIZE('Table','Table'[Name],"Price",SUM('Table'[Price]))
return CALCULATE(COUNT('Table'[Name]),FILTER(_a,[Price]=SELECTEDVALUE('Summed Price'[Price])))

vjianbolimsft_1-1685588801583.png

Final output:

vjianbolimsft_2-1685588838819.png

vjianbolimsft_3-1685588853719.png

Best Regards,

Jianbo Li

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

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.