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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Migscruz
Helper I
Helper I

How to use IF Dax & count

Hi!

 

I'm trying to do this in PBI. I'm comparing the sales of January vs sales of January LY. It seems that there are a few stores that didn't have sales LY bcs of numerous reasons. I want to use a chart to tell me the number of stores that have sales less than <100 or <=0 this year and last year so i can do better comparisons:

 

Migscruz_0-1614005864076.png

Thanks!!

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Migscruz ,

You can create measures like

 

countx(values(Table[store]), if([sale TY]+0 <100,Table[Store], blank()))

 

countx(values(Table[store]), if([sale LY]+0 <100,Table[Store], blank()))

View solution in original post

2 REPLIES 2
VijayP
Super User
Super User

@Migscruz 

Also you can create 

1 measeure 

Total Sales = SUM('Table'[Sales Jan])
2 nd MEasure
No Sales = CALCULATE(COUNT('Table'[Strone Name]),FILTER(ALL('Table'),[Total Sales]=0))
based on that  you can construct rest measures
you can use this pbix for testing



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


amitchandak
Super User
Super User

@Migscruz ,

You can create measures like

 

countx(values(Table[store]), if([sale TY]+0 <100,Table[Store], blank()))

 

countx(values(Table[store]), if([sale LY]+0 <100,Table[Store], blank()))

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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