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

View all the Fabric Data Days sessions on demand. View schedule

Reply
nankerp
Helper III
Helper III

DAX - Show value 1 if value in a month - If no zero

In my datamodel I want to show the value 1 if there is any turnover that certain month. If not zero.

 

I thougth it was easy by just using IF([turnover]>0;1;0) but the products are not grouped. I need the product only mentioned one time for right subgroup.

1 ACCEPTED SOLUTION

I think I found a solution. 

 

What I did was first making a measure: 

COTGTZero=sumx(factTurnover;if(factTurnover[Sales]>0;1;0)).

 

Then I made a new Measure: 

ShowOneIfSalesThatMonth=COTGTZero/COTGTZero.

 

It works when I show it in my report.

View solution in original post

2 REPLIES 2
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @nankerp,

 

Could you please post a sample and the result you want? 

 

Best Regards!

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I think I found a solution. 

 

What I did was first making a measure: 

COTGTZero=sumx(factTurnover;if(factTurnover[Sales]>0;1;0)).

 

Then I made a new Measure: 

ShowOneIfSalesThatMonth=COTGTZero/COTGTZero.

 

It works when I show it in my report.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors