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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Anonymous
Not applicable

How to Omit part of time series for one department

We have a model where we have some outlier-values in a measure for one department until a given date. We want to keep the values in the model, but hide them from one of the visuals.

 

2022-06-24_16-11-43.png

Basically I try to express a condition:

 

 

FilterTest = if(Sheet1[Department] = "New Haven" && Sheet1[Date] < 08/01/2021, 0, 'Key Measures'[SumXvalue])

 

 

... hoping that this will give me nothing for New Haven until August 2021 and the original value for all other departments, including for New Haven from August 2021 onwards.

 

 I have tried various IF, SWICTH, CALCULATE and FILTER combos, but always end up with an error: 

A single value for column 'Department' in table 'Sheet1' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result.

 

The value we are working with in the real case is the result of a complex calculation (two 12-month rolling averages divided by eachother) so I cannot just omit the value from the underlying query.

 

I have uploaded a small pbix-file that illustrates the essence of the problem. Link to PBIX-file 

 

Any suggestions would be highly appreciated.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

HI

 

I create a new table with a date giving the start date you want to show results for each department 

DepartmentDate
Madrid01/01/2018
Copenhagen01/01/2018
New Haven01/07/2021

and after i changed your measure

FilterTest =

var dategraph = min(Sheet1[Date])
var site= SELECTEDVALUE(Sheet1[Department])
var datemin=LOOKUPVALUE(Date_Afich[Date],Date_Afich[Department],site)

var result = if(dategraph>datemin,[SumXvalue])
return
result
JamesFr06_0-1656085220956.png

Hope this will help you

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

HI

 

I create a new table with a date giving the start date you want to show results for each department 

DepartmentDate
Madrid01/01/2018
Copenhagen01/01/2018
New Haven01/07/2021

and after i changed your measure

FilterTest =

var dategraph = min(Sheet1[Date])
var site= SELECTEDVALUE(Sheet1[Department])
var datemin=LOOKUPVALUE(Date_Afich[Date],Date_Afich[Department],site)

var result = if(dategraph>datemin,[SumXvalue])
return
result
JamesFr06_0-1656085220956.png

Hope this will help you

Anonymous
Not applicable

Thank you very much! This worked and has now been implemented in the main model. Also served as an illustration on how we can share ideas and solutions in the forum. Great!

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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