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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
wzorn40
New Member

Conditional CALCULATE based on if a table ISEMPTY

I'm trying to create a measure that conditionally picks what type of filter to used based on if the results of one filter returns an empty table.  This measure feeds a line chart.  The DAX is below.

 

The problem I'm having is this:  If the ISEMPTY() evalutes to TRUE, only metric2 values are graphed, but if ISEMPTY() evaluates to FALSE, BOTH metric1 and metric2 values are graphed.

 

I'm still investigating, but can you see anything wrong with the DAX?  Thanks!

 

 

Out = IF(
     ISEMPTY(
          CALCULATETABLE(
               'table',
               'table'[metric] = "metric1"
          )
     ),
     CALCULATE(
          SUM('table'[score]),
          FILTER('table', 'table'[metric] = "metric2")
     ),
     CALCULATE(
          SUM('table'[score]),
          FILTER('table', 'table'[metric] = "metric1")
     )
)

 

2 REPLIES 2
Anonymous
Not applicable

Hi @wzorn40 ,

Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or if you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.

Thanks for your efforts & time in advance.

 

Best regards,
Community Support Team_ Binbin Yu

wzorn40
New Member

UPDATE:  It has something to do with the conditional statement.  If I substitule "TRUE" or "FALSE" instead of the ISEMPTY() function, it works correctly.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.