cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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:

Thanks!!

1 ACCEPTED SOLUTION
Super User

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()))

2 REPLIES 2
Super User

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

MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!

Super User

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()))

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.