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
Anonymous
Not applicable

Filter Not working Properly after Applying if condition on Measure

Hi,

I have two tables in my Model.One is Date Dim and other is a fact table.

Tables are connected using date field. Fact table is having a column Volume that needs to be aggregated using AVERGAE builtin function.Mesaure is created with Average function [Avg= AVERGAE(Volume)] .Now if condition is applied on this mesaure 

(If condition :  ""If Average is blank show "TBD" else Average" ) and used in my tabular format report. We have year filter on top.

After adding if condition year filter is not working properly. Any Idea?  Thanks in Advance

 

Nitz

7 REPLIES 7
Payeras_BI
Super User
Super User

Hi @Anonymous ,

Is this the same issue?

 

Average Measure with IF Condition + ISEMPTY =
VAR _Average = [Average Measure Without If Condition]
RETURN
    IF (
        ISEMPTY ( 'Summary' ),
        BLANK (),
        IF ( ISBLANK ( _Average ), "TBD", FORMAT ( _Average, "Currency" ) )
    )

 

Regards,

 

If this post answered your question, please mark it as a solution to help other users find useful content.
Kudos are another nice way to acknowledge those who tried to help you.

J. Payeras
Mallorca, Spain
amitchandak
Super User
Super User

@Anonymous ,Based on what I got

a new measure , assume Avg is measure

if(isblank([Avg], "TDB", [Avg])

Anonymous
Not applicable

@amitchandak : Yes formula is correct and I have used the same [if(isblank([Avg], "TDB", [Avg])] but when I add this mesaure to my tabular format report,filter given on Year stop working properly.

 

Anonymous
Not applicable

@amitchandak : One more thing if I remove "If condition" from this mesaure then Year Filter is working properly.

@Anonymous , If handle null then it will show all year, It will show all year, we have force filter again

try like

measure =

calculate(if(isblank([Avg], "TDB", [Avg]), filter(Table, Table[Year] in allselected(Table[Year]) ))

Anonymous
Not applicable

@amitchandak : Tried..But still not working 

Hi @Anonymous!  Did you get the solution? I've the same issue: Date filter not working in a conditional measure - Microsoft Power BI Community

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.