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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
shushank
Frequent Visitor

Help me with a tricky DAX situation

Hi All,

I am connected to a cube(SSAS) and trying to write a measure(since I can't add calc column). My scenario is 

 

I have two column lets say A and B.

Both these columns have blanks and numbers and in a Matrix visual, I am using a subtotal for both the columns.

Now, I don't want to add the number where any column has blank against each other. What I mean to say

if both the columns have values then only add those values rest ignore. 

 

let me know if more details are required.

 

Thanks,

S

 

 

2 REPLIES 2
OwenAuger
Super User
Super User

Hi @shushank 

 

If I understand you correctly, you want to calculate a measure with a filter applied so that both A & B are nonblank.

 

Since this condition is the intersection of two nonblank conditions, you could write something like this:

Measure with A and B nonblank =
CALCULATE (
    [Original Measure],
    KEEPFILTERS ( NOT ISBLANK ( YourTable[A] ) ),
    KEEPFILTERS ( NOT ISBLANK ( YourTable[B] ) )
)

 

I suggest including KEEPFILTERS in order to retain any existing filters on either A or B.

 

Is this what you're looking for?

 

Regards,

Owen


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn
Anonymous
Not applicable

Measure with A and B nonblank =
CALCULATE (
    [Original Measure],
    Filter(TaBLE,TABLE[col1]<>Blank() && table[Col2]<>Blank)
)

 

Thanks & regards,
Pravin Wattamwar
www.linkedin.com/in/pravin-p-wattamwar

If I resolve your problem Mark it as a solution and give kudos.

 

check my blog here
https://community.powerbi.com/t5/Community-Blog/Connecting-to-a-Tabular-Model-Using-Power-BI/ba-p/91...

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!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.