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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
tqn3728
New Member

Counting Records that don't exist

Been trying to figure out a good way to Count records that has no value.

 

In this measure i'm trying to count the numbers of Stores by Product and week that have no sales. I got it semi working but because im on a Calendar, some dates go into other weeks which results in a wrong number in certain weeks between months which I circle in blue. Is there a better way to go about this?

 

tqn3728_0-1751409300984.png

Void = 
COUNTROWS(FILTER(
    SUMMARIZECOLUMNS(
        'Date Table'[Calendar Year],
        'Date Table'[Calendar Week],
        DimItem[Product],
        DimStore[Store],
        "Sales", ignore([Gross Sales])
    ), [Sales]= 0
))

 

2 REPLIES 2
v-sdhruv
Community Support
Community Support

Hi @tqn3728 ,

Just wanted to check if you had the opportunity to review the suggestions provided?
Thank you @Shravan133  for your prompt response.
If it hasnt, then please consider sending a sample data.
How to provide sample data

Thank You

 

Shravan133
Super User
Super User

Instead of using just Calendar Week, use a unique week key that combines year and week number, such as 'Date Table'[YearWeek] or build one like:
YearWeek = 'Date Table'[Calendar Year] * 100 + 'Date Table'[Calendar Week]

Void Stores =

COUNTROWS(

    FILTER(

        ADDCOLUMNS(

            SUMMARIZE(

                'Date Table',

                'Date Table'[Calendar Year],

                'Date Table'[Calendar Week],

                DimItem[Product],

                DimStore[Store]

            ),

            "TotalSales", CALCULATE(SUM(FactSales[Gross Sales]))

        ),

        [TotalSales] = BLANK() || [TotalSales] = 0

    )

)

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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