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
Anonymous
Not applicable

Apply data segmentation to a cumulative count

Hello

I'm trying to apply a segmentation of data through a visual that respects this DAX filter

S/d acumulado á calculate('Checkin-Chekout'[Tipe]),

filter(all('Checkin-Chekout'),

'Checkin-Chekout'[Fecha .] <'max('Checkin-Chekout'[Fecha .])))
This DAX counts check-in/check-out and aplies a filter that accumulates them by date.
The problem is that when I use the segmentation visual with the 'Checkin-Chekout' column, dosen't show the accumulated count of that hotel by date and that's what I want.
Can someone help me?
Thanks a lot.
1 ACCEPTED SOLUTION
Anonymous
Not applicable

@V-pazhen-msftthis only works when I choose a hotel to filter, not what counts everything. However, you have solved here in another thread of mine with the same problem that I unintentionally duplicated.

But I'm still untrained in how the DAX you wrote in this real thread would fit to show the hole count and not as it did on the blue line

Thanks a lot!

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@Anonymous , Did not get it completely. But it better to move you Date to date table and have that filter there

S/d acumulado á calculate([Tipe],
filter(all('Date'),
'Date'[Fecha .] <max('Date'[Fecha .])))

 

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 :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

Anonymous
Not applicable

@amitchandak 

Thanks for the answer, but it does not still suits me.

I've created the table acording to the tutorials you gave me, and the DAX it's now like this:

Acumulated s/d = CALCULATE(count('Chekin Checkout'[Type]), 

filter(all('Chekin Checkout'), 'Chekin Checkout'[Type] = "Checkout" ),

filter (all(Dates), Dates[Date] <= max(Dates[Date])))
Earlier before I forgot to add a boolean for the "Check out" cases so i've added it above. The Dates Table still does not solves my problem (it is correctly related with Checkin Checkout table).
My problem is that i want to show the acumulatation of the checkouts globally (i could do this with de DAX above), AND by Hotel with this visual data segmentation by hotel (it is in spanish).
When i click one of those hotels, it does not show me the checkouts acumulations for that hotel (by date) in my line graph; the global number of checkouts is maintained no matter what hotel i choose.
e.g. graph line 
 
 

@Anonymous 

Try add another hotel filter to the dax, something like:

 

Acumulated s/d = CALCULATE(count('Chekin Checkout'[Type]), 

filter(all('Chekin Checkout'), 'Chekin Checkout'[Type] = "Checkout" ), 

filter (all(Dates), Dates[Date] <= max(Dates[Date])),

Filter(all(Chekin Checkout),sumx(filter(Chekin Checkout,earlier(Chekin Checkout[hotel])=Chekin Checkout[hotel]),1))

 

 

Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

@V-pazhen-msftthis only works when I choose a hotel to filter, not what counts everything. However, you have solved here in another thread of mine with the same problem that I unintentionally duplicated.

But I'm still untrained in how the DAX you wrote in this real thread would fit to show the hole count and not as it did on the blue line

Thanks a lot!

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.