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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
bzeeblitz
Helper IV
Helper IV

query does not return records

I have 2 tables which is coming from single excel sheet from two different tabs.so below query not returning any records

 

CombinedCriteriaCount =

var totalrows = CALCULATE(

    COUNTROWS('Open'),

    Open[StatusIsYesterday] = 1,  -- Condition for Open (Created Yesterday)

    Demand[CriteriaMOS>9] = 1 -- Condition for Demand (MOS > 9)

)

RETURN COUNTROWS(Open)

 

I have written the above query in my bridge table ->combinedcriteria formula

bzeeblitz_0-1743010751789.png

 

 

 

CriteriaMOS>9 = if(Demand[Months of Supply]>9,1,0)

bzeeblitz_3-1743010979949.png

 

StatusIsYesterday = if(Open[Date: Line Created].[Date] = TODAY()-1,1,0)

bzeeblitz_2-1743010918390.png

 

So im not sure why my report is not returning records but it has some datas where i checked manually for above conditions

1 ACCEPTED SOLUTION
d_m_LNK
Resolver II
Resolver II

In reading the original measure I think it's just correcting the RETURN statement.  Change it to this instead

 

CombinedCriteriaCount =

var totalrows = CALCULATE(

    COUNTROWS('Open'),

    Open[StatusIsYesterday] = 1,  -- Condition for Open (Created Yesterday)

    Demand[CriteriaMOS>9] = 1 -- Condition for Demand (MOS > 9)

)

RETURN TotalRows

View solution in original post

2 REPLIES 2
d_m_LNK
Resolver II
Resolver II

In reading the original measure I think it's just correcting the RETURN statement.  Change it to this instead

 

CombinedCriteriaCount =

var totalrows = CALCULATE(

    COUNTROWS('Open'),

    Open[StatusIsYesterday] = 1,  -- Condition for Open (Created Yesterday)

    Demand[CriteriaMOS>9] = 1 -- Condition for Demand (MOS > 9)

)

RETURN TotalRows

CombinedCriteriaCount =

var totalrows = CALCULATE(

    COUNTROWS(Open),

    Open[StatusIsYesterday] = 1,  -- Condition for Open (Created Yesterday)

    Demand[CriteriaMOS>9] = 1 -- Condition for Demand (MOS > 9)

)

RETURN if(totalrows>0,"Created Yesterday: "  & totalrows &" having more than 9 months ", "Nothing was created yesterday meeting criteria of more than 9 months"

)

 

Highlighted in red showing blank total but visual reports displaying some data below

 

bzeeblitz_0-1743055706535.png

 

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.