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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
PBI5851
Helper V
Helper V

Creating a Chart with x axis to be dynamic

Hello,

I am trying a develop a graph using the below data 

OrderNoOrdDateCallTypeCallDateCallID
A12312/20/2022Initial1/2/2023C1234
A12312/20/2022Initial1/2/2023C1235
A12312/20/2022Service1/5/2023C1236
A12312/20/2022Service1/7/2023C1237
A12312/20/2022Service1/8/2023C1238
A12312/20/2022Shipping1/8/2023C1239
A12312/20/2022Shipping1/8/2023C1240
A12312/20/2022Service1/9/2023C1241
A12312/20/2022Service1/10/2023C1242
A12312/20/2022Service1/11/2023C1243
A12312/20/2022Service1/12/2023C1244
B12311/15/2022Initial1/3/2023C1245
C12311/20/2022Initial1/5/2023C1246
D12311/25/2022Initial1/5/2023C1247
D12311/25/2022Service1/10/2023C1248
D12311/25/2022Shipping1/10/2023C1249
E1231/2/2023Initial1/2/2023C1250
E1231/2/2023Shipping1/5/2023C1251
E1231/2/2023Shipping1/5/2023C1252

 

The requirement is to have a calldate and orddate slicer but plot in 3 unique graphs the below. 

- An Initial call count graph

- A Service call count graph

- A shipping call count graph

the graph should be the distinct count of Orders who have had 0, 1, 2, 3, 4, 5 Initial call, where 0,1,2,3,4,5 is on the x axis 

 

For a Shipping call count graph:

With a OrdDate Slicer from 11/1/22 - 1/31/22 AND with a call date slicer as 12/1/22 - 12/20/22

the first column for 0 (on x axis) should be 5 (this is because none of the 5 orders had calls within the secondary date range)

 

With a OrdDate Slicer from 11/1/22 - 1/31/22 AND with a call date slicer as 1/1/23 - 1/20/23

the first column for 0 (on x axis) should be 2 (this is because B123 and C123 had 0 calls within the secondary date range)

the second column for 1 (on x axis) should be 3 (because A123, D123, E123 each had atleast 1 shipping call within the secondary date range)

 

With a OrdDate Slicer from 11/1/22 - 1/31/22 AND with a call date slicer as 1/1/23 - 1/5/23

the first column for 0 (on x axis) should be 4 (this is because A123, B123, C123, D123 had 0 calls within the secondary date range)

the second column for 1 (on x axis) should be 1 (because A123, D123, E123 each had atleast 1 shipping call within the secondary date range)

 

The same concept for Initial and Service calls. I did try to use a summarize table solution, but the slicer is throwing me off. When i select the date, the members with no calls dont show (i.e column with 0 calls). And if i use the EXCEPT , then the filter is not applied at all. 

 

Any recommendations on how to resolve this please.

1 ACCEPTED SOLUTION
tex628
Community Champion
Community Champion

Hi @PBI5851 , 

I've tried to recreate what i believe is your end-goal. 

tex628_2-1672915401644.png


How does this match your intended output? 

It's done with the following measures: 

Shipping Call Count = 
VAR totalOrders = CALCULATE( DISTINCTCOUNT( Orders[OrderNo] ) , REMOVEFILTERS( Orders[CallDate] ))
VAR WithCalls = COUNTROWS( FILTER ( SUMMARIZE( Orders , Orders[OrderNo] , Orders[CallType] , "Value" , COUNTROWS( Orders ) ) , [Value] >= 1 && Orders[CallType] = "Shipping") )
Return
SWITCH( SELECTEDVALUE( 'Count'[Count] ) , 
"0" , totalOrders - WithCalls ,
"1" , WithCalls
)
Service Call Count = 
VAR totalOrders = CALCULATE( DISTINCTCOUNT( Orders[OrderNo] ) , REMOVEFILTERS( Orders[CallDate] ))
VAR WithCalls = COUNTROWS( FILTER ( SUMMARIZE( Orders , Orders[OrderNo] , Orders[CallType] , "Value" , COUNTROWS( Orders ) ) , [Value] >= 1 && Orders[CallType] = "Service") )
Return
SWITCH( SELECTEDVALUE( 'Count'[Count] ) , 
"0" , totalOrders - WithCalls ,
"1" , WithCalls
)
Initial Call Count = 
VAR totalOrders = CALCULATE( DISTINCTCOUNT( Orders[OrderNo] ) , REMOVEFILTERS( Orders[CallDate] ))
VAR WithCalls = COUNTROWS( FILTER ( SUMMARIZE( Orders , Orders[OrderNo] , Orders[CallType] , "Value" , COUNTROWS( Orders ) ) , [Value] >= 1 && Orders[CallType] = "Initial") )
Return
SWITCH( SELECTEDVALUE( 'Count'[Count] ) , 
"0" , totalOrders - WithCalls ,
"1" , WithCalls
)


Plus a small static table to populate the x-axis:

 

tex628_3-1672915524816.png


/ J

 


Connect on LinkedIn

View solution in original post

3 REPLIES 3
tex628
Community Champion
Community Champion

Hi @PBI5851 , 

I've tried to recreate what i believe is your end-goal. 

tex628_2-1672915401644.png


How does this match your intended output? 

It's done with the following measures: 

Shipping Call Count = 
VAR totalOrders = CALCULATE( DISTINCTCOUNT( Orders[OrderNo] ) , REMOVEFILTERS( Orders[CallDate] ))
VAR WithCalls = COUNTROWS( FILTER ( SUMMARIZE( Orders , Orders[OrderNo] , Orders[CallType] , "Value" , COUNTROWS( Orders ) ) , [Value] >= 1 && Orders[CallType] = "Shipping") )
Return
SWITCH( SELECTEDVALUE( 'Count'[Count] ) , 
"0" , totalOrders - WithCalls ,
"1" , WithCalls
)
Service Call Count = 
VAR totalOrders = CALCULATE( DISTINCTCOUNT( Orders[OrderNo] ) , REMOVEFILTERS( Orders[CallDate] ))
VAR WithCalls = COUNTROWS( FILTER ( SUMMARIZE( Orders , Orders[OrderNo] , Orders[CallType] , "Value" , COUNTROWS( Orders ) ) , [Value] >= 1 && Orders[CallType] = "Service") )
Return
SWITCH( SELECTEDVALUE( 'Count'[Count] ) , 
"0" , totalOrders - WithCalls ,
"1" , WithCalls
)
Initial Call Count = 
VAR totalOrders = CALCULATE( DISTINCTCOUNT( Orders[OrderNo] ) , REMOVEFILTERS( Orders[CallDate] ))
VAR WithCalls = COUNTROWS( FILTER ( SUMMARIZE( Orders , Orders[OrderNo] , Orders[CallType] , "Value" , COUNTROWS( Orders ) ) , [Value] >= 1 && Orders[CallType] = "Initial") )
Return
SWITCH( SELECTEDVALUE( 'Count'[Count] ) , 
"0" , totalOrders - WithCalls ,
"1" , WithCalls
)


Plus a small static table to populate the x-axis:

 

tex628_3-1672915524816.png


/ J

 


Connect on LinkedIn

Thank you @tex628 . Wil try it out. Can you send me your pbix file please.

tex628
Community Champion
Community Champion

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.