cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
EmetSelch Frequent Visitor
Frequent Visitor

calculating a kind of histogram that responds to filters

greetings,

 

here's what i want to achieve:

several agents create calls with customers and log the date, the type etc.. i want to count the calls made on the same day (for every day), then i want to know the accumulation of calls per day (like, there were 3 occurances (dates) with 5 calls made on that day, 8 occurances with 1 call a day etc.)

 

i want to display the accumulation of calls with an x-axis (1 -> max calls per day) and an y-axis (accumulation of calls per day). thats all well and easy for the totals of calls per day, but i need to be able to filter the visual for agents (user), call type etc. using slicers or drill-through action.

 

my call table looks something like this:

 

createdOn   | userId | callType    | callId

dd.mm.yyyy | 1         | face2face  | 12345

 

for the x-axis i created a sperate table with:

xAxis = GENERATESERIES( 1; IF( ( MAX( call[callsOnThisDay] ) < 19 ); 19; MAX( call[callsOnThisDay] ) ); 1 )

and a column in my call table:

callsOnThisDay = SUMX( call; IF( call[createdOn] = EARLIER( call[createdOn] ); 1; 0 ) )

 

the callsOnThisDay column could be used if i just wanted to display the totals, unfiltered by agents or type. but that's not good for what my client wants. he needs filters ..

 

 

i'm fairly new to Power BI and i'm having troubles getting what i want from DAX, any help would be awesome.

 

1 ACCEPTED SOLUTION

Accepted Solutions
EmetSelch Frequent Visitor
Frequent Visitor

Re: calculating a kind of histogram that responds to filters

thanks for the reply, not what i had hoped for though ..

could you maybe propose a workaround with similar results?

 

edit:

what i did now was this:

created a column in call table that calculates how many calls were made on the same day, another column in call table that calculates how many calls the agent of the call made that day.

to build the visuals, i create new index tables for every calculated column for call frequency and relate the column in call table with the index of the corresponding index table.

here's the DAX:

 

Calls total =IF(call[completed] = TRUE();SUMX(call;IF(call[date] = EARLIER(call[Date fix]) && call[Call] = TRUE();CALCULATE(DISTINCTCOUNT(call[callID]));0)))

 

Calls agents = IF(v_call[Call] = TRUE();CALCULATE(DISTINCTCOUNT(call[callID]);ALLEXCEPT(call;call[userID];call[date];call[type]));BLANK())

 

index Calls total = GENERATESERIES(1;MAX(call[Calls total]);1)

 

index Calls agents = GENERATESERIES(1;MAX(call[Calls total]);1)

 

 

View solution in original post

2 REPLIES 2
Community Support Team
Community Support Team

Re: calculating a kind of histogram that responds to filters

HI @EmetSelch ,

In fact, current power bi does not support to create dynamic calculate column/table based on filter/slicer. Dax formula which you used to get selected value will be fixed(it will calculate on 'whole' table) and return the static result.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, please consider Accept it as the solution to help the other members find it more quickly
Learning resources: Power BI
EmetSelch Frequent Visitor
Frequent Visitor

Re: calculating a kind of histogram that responds to filters

thanks for the reply, not what i had hoped for though ..

could you maybe propose a workaround with similar results?

 

edit:

what i did now was this:

created a column in call table that calculates how many calls were made on the same day, another column in call table that calculates how many calls the agent of the call made that day.

to build the visuals, i create new index tables for every calculated column for call frequency and relate the column in call table with the index of the corresponding index table.

here's the DAX:

 

Calls total =IF(call[completed] = TRUE();SUMX(call;IF(call[date] = EARLIER(call[Date fix]) && call[Call] = TRUE();CALCULATE(DISTINCTCOUNT(call[callID]));0)))

 

Calls agents = IF(v_call[Call] = TRUE();CALCULATE(DISTINCTCOUNT(call[callID]);ALLEXCEPT(call;call[userID];call[date];call[type]));BLANK())

 

index Calls total = GENERATESERIES(1;MAX(call[Calls total]);1)

 

index Calls agents = GENERATESERIES(1;MAX(call[Calls total]);1)

 

 

View solution in original post

Helpful resources

Announcements
Coming Soon: T-Shirt Design Contest

Coming Soon: T-Shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power BI Desktop Update - February 2020

Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors