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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

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
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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.