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

Get Fabric Certified for FREE during AI Skills Fest. This week only. Secure your voucher now.

Reply
Alta88
Helper IV
Helper IV

Card Visual - Troubleshoot

My card visual should show total errors from the previous day's accounts but it's returning 'blank': 

 

Alta88_0-1723146633639.png

 

 

I've used the following measure for the field value: 

 

Error Count =
VAR CurrentDate = TODAY()
VAR PrevDay = TODAY() - 1
VAR DayOfWeek = WEEKDAY(CurrentDate, 2) -- 2 = Monday, 3 = Tuesday, 4 = Wednesday, 5 = Thursday, 6 = Friday, 7 = Saturday, 1 = Sunday

VAR SelectedDate = IF(DayOfWeek = 1, PrevDay - 1, CurrentDate)

RETURN
    CALCULATE(
        COUNTROWS('DataPool Merge 2024'),
        'DataPool Merge 2024'[Date] = SelectedDate,
        'DataPool Merge 2024'[Status] = "Error"
    )
 
 
This is my table layout: 
 
Alta88_1-1723146745549.png

 

Do I need to rename fields or tables in the DAX measure? 

1 ACCEPTED SOLUTION
hackcrr
Super User
Super User

@Alta88 

You can use the following adjusted DAX expression:

Error Count = 
VAR CurrentDate = TODAY()
VAR PrevDay = CurrentDate - 1
VAR DayOfWeek = WEEKDAY(CurrentDate, 2) -- 2 = Monday, 7 = Sunday
VAR SelectedDate = 
    IF(
        DayOfWeek = 1, -- If today is Monday, check for Friday's data
        CurrentDate - 3,
        PrevDay
    )
RETURN 
    CALCULATE(
        COUNTROWS('Table'),
        'Table'[Date] = SelectedDate,
        'Table'[Status] = "Error"
    )

hackcrr_0-1723154911725.png

The results are as follows:

hackcrr_1-1723155024040.png

 

 

Best Regards

hackcrr

If I have answered your question, please mark my reply as solution and kudos to this post, thank you!

 

View solution in original post

2 REPLIES 2
Alta88
Helper IV
Helper IV

Great! It worked! Thank you for your help!

hackcrr
Super User
Super User

@Alta88 

You can use the following adjusted DAX expression:

Error Count = 
VAR CurrentDate = TODAY()
VAR PrevDay = CurrentDate - 1
VAR DayOfWeek = WEEKDAY(CurrentDate, 2) -- 2 = Monday, 7 = Sunday
VAR SelectedDate = 
    IF(
        DayOfWeek = 1, -- If today is Monday, check for Friday's data
        CurrentDate - 3,
        PrevDay
    )
RETURN 
    CALCULATE(
        COUNTROWS('Table'),
        'Table'[Date] = SelectedDate,
        'Table'[Status] = "Error"
    )

hackcrr_0-1723154911725.png

The results are as follows:

hackcrr_1-1723155024040.png

 

 

Best Regards

hackcrr

If I have answered your question, please mark my reply as solution and kudos to this post, thank you!

 

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.