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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
davidz106
Helper III
Helper III

DAX calculates values for fields not included in original table

I am having a problem with DAX formula. 

 

I have two tables with following relations

EVS                        ALL_IDS

ID           *:1            ID

value    

 

I want to show a table visualization with ID (All_IDs) and a following measures based on EVS table:

average(value)

stdev.s(value)

custom measure named AA_ID

 

 

 

AA_ID =
IF (
    [Average_ID] < 88.5,
    ( 88.5 - [Average_ID] ) + 1.4 * [STDEV_ID],
    IF (
        [Average_ID] > 91.5,
        ( [Average_ID] - 91.5 ) + 1.4 * [STDEV_ID],
        [STDEV_ID] * 1.4
    )
)

 

 

 

Measure AA_ID calculates for all the IDs in EVS table but also for the IDs (ALL_IDS) that are not present in EVS table which is unwanted behavior. Value 88.5 is shown for those IDs. I figured out that DAX take 0 as average and stdev in those cases instead of null and still calculates AA_ID (which is 88.5 in case of other two measures being 0).

How can I filter those out (I want the calculation to be performed only for my EVS table). At the same time (because of other graphs) I still want to be able to filter by  ID (All_IDs).

1 ACCEPTED SOLUTION

I found a solution, a very ugly one so if anybody has better idea I would aprreicate it. 

 

I defined a new measure:

IF ([AA_ID] = 88.5, blank (), [AA_ID])

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@davidz106 . Try like

 

Calculate( IF (
[Average_ID] < 88.5,
( 88.5 - [Average_ID] ) + 1.4 * [STDEV_ID],
IF (
[Average_ID] > 91.5,
( [Average_ID] - 91.5 ) + 1.4 * [STDEV_ID],
[STDEV_ID] * 1.4
)
), not(isblank(EVS([ID])) )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

I found a solution, a very ugly one so if anybody has better idea I would aprreicate it. 

 

I defined a new measure:

IF ([AA_ID] = 88.5, blank (), [AA_ID])

This does not seem to work. Nothing changes  if I use:

 

 

 

AA_ID =
CALCULATE (
    IF (
        [Average_ID] < 88.5,
        ( 88.5 - [Average_ID] ) + 1.4 * [STDEV_ID],
        IF (
            [Average_ID] > 91.5,
            ( [Average_ID] - 91.5 ) + 1.4 * [STDEV_ID],
            [STDEV_ID] * 1.4
        )
    ),
    NOT ( ISBLANK ( EVS[ID] ) )
)

 

or EVS[value] for that matter. I also tried EVS[value]>0 in second to last row with no success.

 

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.