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
Anonymous
Not applicable

Previous day Error

My tables are as follows and i dont have a separate table connected to it
Date            company count
13/03/2019  A                2           
3/03/2019     B                3
13/03/2019  C                2
14/03/2019   A                2
14/03/2019    B               1

My formula looks like
Yesterday=Calculate(count(count),previousday(date)
When i use slicer on the date on 14/03/2018

Result comes like
Today yesterday
Company A 2 2
Company B 1 3


Here everything works except company C not showing up

That is the only problem

 

 

Can anybody help please?

3 REPLIES 3
v-shex-msft
Community Support
Community Support

HI @Anonymous,

You can try to use following calculate column formula to get previous date records based on current company group:

Yesterday =
CALCULATE (
    COUNT ( Table[Count] ),
    FILTER (
        ALL ( Table ),
        [Company] = EARLIER ( Table[Company] )
            && [Date]
                = EARLIER ( Table[Date] ) - 1
    )
) + 0

Regards,

Xiaoxin Sheng

 

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Anonymous
Not applicable

Hi

 

Thanks for the reply unfortunately it didn't work

 

i could make the earlier dax work at all

 

after i enter the earlier the column name's not detecting

Hi @Anonymous ,

I think these records are in same table, right? If this is a case,
When you choose 3/14/2019, 'company c' not has corresponded records so it will be filtered by your slicer first.

In my opinion, I'd like to suggest you add a calendar table without any relationship and use calendar date and original table company to create matrix.

After these steps, you can write measure to lookup values based on current row contents.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

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.