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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
xiumi_hou
Post Partisan
Post Partisan

urgent: Quick question for dax

Dear all,

 

I have two measures.  I want to count the number of [measure 1] that the measure 2's result is 0

 

When I use measure 1 as a card view and put measure 2 to a filter(set=0) which works fine.

However when I want to combine those two into one measure, it give wrong result(blank) as below. Can anyone help? 

SF_Before_A1 = calculate([SF_case_inactive],FILTER('Calls','Calls'[Count_Held_Sessions_A1]=0))
 
 

Measure 1:

SF_case_inactive = calculate([Count_SF_Cases],USERELATIONSHIP('Date'[Date],'Cases'[Cases_cstm.closed_date_c]))
 

Measure 2: 

Count_Held_Sessions_A1 =
CALCULATE(
COUNT(Calls[Parent_id])+0,
FILTER(
Calls,
Calls[status]="Held"&&
Calls[Type_c]="Assessment"
 
))
1 ACCEPTED SOLUTION

Hi @xiumi_hou ,

 

Yes,my measure is based on yours,have you tried it?

Your measure "SF_Before_A1" should be corrected to either of the following ones:

 

SF_Before_A1 = calculate([SF_case_inactive], 'Calls'[Count_Held_Sessions_A1]=0)

 

Or

 

SF_Before_A1 = If ('Calls'[Count_Held_Sessions_A1]=0,[SF_case_inactive],blank())

 

I just advise you not to use "filter" funtion in this situation.

And measure 1 and measure 2 remain the same.

Pls try it and advise me if there's any error returned.

 

Best Regards,

Kelly

View solution in original post

4 REPLIES 4
v-kelly-msft
Community Support
Community Support

Hi @xiumi_hou

 

Measure “SF_Before_A1” should be corrected as below:

 

 

SF_Before_A1 = calculate([SF_case_inactive], [Count_Held_Sessions_A1]=0)

 

Or  

 

SF_Before_A1 = If ([Count_Held_Sessions_A1]=0,[SF_case_inactive],blank())

 

 

 

As you’re calculating a result based on measure 1,and measure 1 is based on table “Cases”, if you wanna use filter function, it should be within table “Cases”.

 

If it doesn’t work, pls show me your sample data.

 

Hope this would help.

 

Best Regards,

Kelly

amitchandak
Super User
Super User

When you filter Measure1 using Measure2 you need to data grouping at some level to filter

Like

Sumx(filter(values(table[id],measure2 >0),measure1)

Sumx(filter(summarize(table[id],"M1",sum(measure2),"M2",sum(measure1)),[M2]>0),[M1])

 

 

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

Can you help me revise mine? Thank you so much

Hi @xiumi_hou ,

 

Yes,my measure is based on yours,have you tried it?

Your measure "SF_Before_A1" should be corrected to either of the following ones:

 

SF_Before_A1 = calculate([SF_case_inactive], 'Calls'[Count_Held_Sessions_A1]=0)

 

Or

 

SF_Before_A1 = If ('Calls'[Count_Held_Sessions_A1]=0,[SF_case_inactive],blank())

 

I just advise you not to use "filter" funtion in this situation.

And measure 1 and measure 2 remain the same.

Pls try it and advise me if there's any error returned.

 

Best Regards,

Kelly

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.