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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
paul_marcault
Frequent Visitor

YEAR Segment Filter not working as expected when a particular measure is in the visual

Hi everyone,

I found some unexpected results using a YEAR filter in a very simple case. Here is the data table:

data.jpg

I defined 2 measures :
Total_Order = SUM(OrderBook[OrderValue])

Cumul =
   VAR CurrentTotal = SUM(OrderBook[OrderValue])
   RETURN

   CALCULATE(SUM(OrderBook[OrderValue]),

                      FILTER(ALLSELECTED(OrderBook[Supplier]), CALCULATE(SUM(OrderBook[OrderValue])) >= CurrentTotal))

 

Time Intelligence Auto Date/Time : is ACTIVATED (per default, on global and current file), allowing to use YEAR from date hierarchy.

visual2.jpg

Using the date visual filters :

With OrderDate=10/03/2022 and 15/08/2022 as expected, 2 rows
With Year=2022, it shows 4 rows, which is not what I expected (I expected only the 2 rows of 2022, so corresponding to supplier1 and supplier2). So strange !
But removing the measure "Cumul" from the visual, working as expected: 2 rows (behaving the same with either OrderDate or Year filter)

DOWNLOAD here   Exemple CUMUL RANKX - 1.pbix 

What is wrong ? Is there something with the measure "Cumul" or some PBI parameters which I am unaware of ?

Thanks for your lights.

3 REPLIES 3
paul_marcault
Frequent Visitor

Hi everyone, that's it. No worry that for such simple test case, a combination of hierachy YEAR filter and a measure provides weird results ? is there a website where I shall adress the point ?

v-jayw-msft
Community Support
Community Support

Hi @paul_marcault ,

 

Looks like CurrentTotal in second measure will also be filtered by allselected() function, you could take a check.

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

Hi Jay, thanks for your reply. (you can play with the file which I made available for download)
To reply to your point: If CurrentTotal was applied ALLSELECTED, then the Cumul calculation would be wrong (it would be constant for each row and equal to the Sum of all OrderValue
and CurrentTotal is set to VAR outside the iteration where ALLSELECTED is used in FILTER(ALLSELECTED(OrderBook[Supplier]). But here the Cumul calculation are correct.

Just look at the difference when you use only the visual filter OrderDate=10/03/2022 and 15/08/2022
and compare when you use only the visual filter YEAR=2022. We shall expect the same results .
The case is so simple, but so strange indeed.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.