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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
HansButenschon
New Member

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

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors