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
Volker
Regular Visitor

Measure to identify sum = zero for a member not successful

Dear forum members,,

 

I have a rather easy appearing topic, but just can't get to the right DAX formula.

 

I'd like to show whether a part number (Sys_Plant_CAM) has a value equal zero in a certain column [lo_indreq] or not. The only obstacle is that the part number has various rows for single dates - some zero and some not zero.

 

I thought it would not be difficult using a Measure like the following to fill the total sum for all those part numbers:

CALCULATE(
    SUM('v_md04_latest'[lo_indreq]),
    ALLSELECTED('v_md04_latest'[Sys_Plant_CAM])
)
 
And then add a clolumn verifying whether the value in this measure is zero or not:
PIR_Y_N_2 = if(v_md04_latest[lo_indreq total for Sys_Plant_CAM]>0, "Y", "N")
 
But the measure does not show the total sum but always the distinct value, hence also the new column is not showing a unique value bot always depending on the date column:
Volker_1-1638290609054.png

 

Thanks for any help how to solve the issue.

 

 

1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

I think you want this instead:

CALCULATE (
    SUM ( 'v_md04_latest'[lo_indreq] ),
    ALLEXCEPT ( 'v_md04_latest', 'v_md04_latest'[Sys_Plant_CAM] )
)

You want to remove all filters except the Sys_Plant_CAM.

View solution in original post

3 REPLIES 3
AlexisOlson
Super User
Super User

I think you want this instead:

CALCULATE (
    SUM ( 'v_md04_latest'[lo_indreq] ),
    ALLEXCEPT ( 'v_md04_latest', 'v_md04_latest'[Sys_Plant_CAM] )
)

You want to remove all filters except the Sys_Plant_CAM.

Thanks Alexis,

it worked perfectly as expected.

watkinnc
Super User
Super User

Try:

 

CALCULATE(
    SUM('v_md04_latest'[lo_indreq]),
    ALL('v_md04_latest'[calmonth]))
 
--Nate

I’m usually answering from my phone, which means the results are visualized only in my mind. You’ll need to use my answer to know that it works—but it will work!!

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.

Top Solution Authors
Top Kudoed Authors