cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PowerBoy
Helper I
Helper I

Strange Date filter behavior

Hello, 

I have this model

PowerBoy_0-1632504635493.png


And this measure

 

 

Overall = 
VAR DoneIssues = CALCULATE(SUM(Issues[Weight]), Issues[Status] == "Done")
VAR Total = CALCULATE(SUM(Issues[Weight]), Issues[Status] <> "Cancelled")
VAR Ratio = DIVIDE(DoneIssues, Total)
RETURNS
IF(ISBLANK(Ratio), 0, Ratio)

 


When I use this measure in a Table visual it works fine but it returns entries for all the Epics registers, even those that do not relate to the year. Strange and not what I want. Although the value of the Measure is right. 

"Wrong" behavior (highlighted rows doesn't belong to selected Year) :

PowerBoy_1-1632504952830.png

PowerBoy_2-1632505034285.png


If I use a Date field belonging to the Epic table in a Filter slicer, it works fine and as expected. The Epics that do not belong to the date just don't appear in the table. 

This behavior is fine, as you can see the registers belonging to 2021 do not appear.  

PowerBoy_3-1632505074019.png
Can you, please, help me to understand this behavior and how can I filter properly by the Date table?

Thanks in advance

2 REPLIES 2
amitchandak
Super User
Super User

@PowerBoy , Please make Year to Epics join 1-M and then check .

 

Also try meausre like

 

Overall = 
VAR DoneIssues = CALCULATE(SUM(Issues[Weight]),filter(Issues, Issues[Status] == "Done"))
VAR Total = CALCULATE(SUM(Issues[Weight]), filter(Issues,Issues[Status] <> "Cancelled"))
VAR Ratio = DIVIDE(DoneIssues, Total)
RETURNS
IF(ISBLANK(Ratio), 0, Ratio)

 

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!
Dashboard of My Blogs !! Connect on Linkedin

Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
Proud to be a Super User!

Hello @amitchandak, thanks for your answer. 

I tried the changes you mentioned but the behavior is the same. 
Anyways, I believe that the expanded Issues table contains the attributes of Date table regardless if the relationship is 1:1 or 1:*.  If it was a FILTER(Issues,... ) thing the behavior would have been wrong when filtering by Epics[Date]. 

Obviously if I remove the IF statement in my measure, it returns BLANK and the row disappears, but that is not the real solution. 

I dont know what could be happening. More opinions are appreciated. 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

November Power BI Update 768x460.png

Check it Out!

Click here to read more about the November 2021 Updates!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.