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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
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

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

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

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)

 

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors