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

Problem related to If condition which is being applied on Calculated measure and gives absurd data

Hi,

 

Problem is related to If condition which is being applied on Calculated measure and gives absurd result.

Below are the two tables connected through Date Field [Date - Launch Date]

 

Nitz_0-1647673520274.png

 

Now I have created a measure which is very simple "Average Measure Without If Condition"=AVERAGE(summary[Volume])

And one slicer "YEAR" added from Date Dim.

Please see below

 

Nitz_2-1647673835919.png

Filter is working fine so far.

 

Now I have created one more measure .

Average Measure with If condition = IF (ISBLANK([Average Measure Without If Condition]),"TBD",FORMAT([Average Measure Without If Condition],"Currency")
 
After adding this measure to the grid it gives abusrd result .Looks like its doing cross joining.
I tried is with Calculate DAX function with filter condtion but that does not work either.
Please help.  Thanks In advance !!
 
Nitz
 
 
 
 
 
 
 

 

 

 

 

 

 

 

1 ACCEPTED SOLUTION
Payeras_BI
Super User
Super User

Hi again @Anonymous ,

I have tried to reproduce your issue on my own and found better solution where you can keep the Year column coming from the Date_Dim table and avoid the cross-join issue when replacing the blanks for something else.
Issue:

Payeras_BI_2-1647815631324.png

 

Solution:

Payeras_BI_3-1647815683410.png

Measure:

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" ) )
    )

I hope this helps. 

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

View solution in original post

3 REPLIES 3
Payeras_BI
Super User
Super User

Hi again @Anonymous ,

I have tried to reproduce your issue on my own and found better solution where you can keep the Year column coming from the Date_Dim table and avoid the cross-join issue when replacing the blanks for something else.
Issue:

Payeras_BI_2-1647815631324.png

 

Solution:

Payeras_BI_3-1647815683410.png

Measure:

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" ) )
    )

I hope this helps. 

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

@Payeras_BI , Thank you so much for your help 😊 .It is working fine.

Simple if was not working and writing this way solving the problem .Its really wierd.

Payeras_BI
Super User
Super User

Hi @Anonymous ,

Does the issue persist when, in your visualization, you remove the column Year coming from your Date_Dim table?

Payeras_BI_0-1647726633519.png

I would create a measure, instead, to get the Year from the Launch Date column. 

Year = YEAR(MAX(Summary[Launch Date]))

Let me know the result. 

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

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.