cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
EmetSelch
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

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
Community Support

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

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
New Ranks Launched March 24th!

New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

‘Better Together’ Contest Finalists Announced!

‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Arun 'Triple A' Event Video, Q&A, and Slides

Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

Join THE global Microsoft Power Platform event series.

Join THE global Power Platform event series.

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors