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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
Anonymous
Not applicable

Accumulated Histogram from Classes obtained by Measures

Hi dear community, 

 

I would like to rank the amount of visits a customer makes to a store and group the results into a histogram.

Imagine the following example:


Client    Visit
aaa           01/01/2021  10:00
aaa           02/01/2021    09:00
aaa           02/01/2021    20:00

This should output:
If 01/01/2021 is selected: "one visit"
If 02/01/2021 is selected: "two visits"
If no date is selected: "> two visits".

And I would like to reflect this in a bar chart (imagine several clients)

ex:
                                                  |

|                                                 |

|                        |                        |

One visit       two visits     > two visits

Thank you for your help,

Simao

1 ACCEPTED SOLUTION
Anonymous
Not applicable

This post of @v-juanli-msft (link)  solved the problem. Thanks anyway

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , if you have datetime column create a seperate date column and join with a date table

 

Date = [datetime].date
or
Date = date(year([datetime]),month([datetime]),day([datetime]))

 

 

Create a measure like

Cumm= CALCULATE(distinctcount(Table[Date]),filter(allselected(date),date[date] <=max(date[Date])))

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Thanks, the meassure works. 

Now the hard part is counting the values of this meassure to make the histogram.

Any idea?

 

Anonymous
Not applicable

This post of @v-juanli-msft (link)  solved the problem. Thanks anyway

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

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