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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

How to calculate?

I have a table

MailTable2.png

I want calculate how many users in interval 25.03.2020 - 30.03.2020 have DateDiff(RefreshDate; ExchangeAct) = 0

1 ACCEPTED SOLUTION
v-gizhi-msft
Community Support
Community Support

Hi,

 

According to your description, i create a simple sample to test:

50.PNG

Then try this measure:

Measure = 
IF (
    CALCULATE (
        COUNTROWS ( 'Table' ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            'Table'[Name] IN DISTINCT ( 'Table'[Name] )
                && 'Table'[ExchangeAct] <> 'Table'[RefreshDate]
        )
    ) > 0,
    1,
    0
)

The result shows:

51.PNG

Here is my test pbix file:

pbix 

Hope this helps.

 

Best Regards,

Giotto Zhi

View solution in original post

6 REPLIES 6
v-gizhi-msft
Community Support
Community Support

Hi,

 

According to your description, i create a simple sample to test:

50.PNG

Then try this measure:

Measure = 
IF (
    CALCULATE (
        COUNTROWS ( 'Table' ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            'Table'[Name] IN DISTINCT ( 'Table'[Name] )
                && 'Table'[ExchangeAct] <> 'Table'[RefreshDate]
        )
    ) > 0,
    1,
    0
)

The result shows:

51.PNG

Here is my test pbix file:

pbix 

Hope this helps.

 

Best Regards,

Giotto Zhi

amitchandak
Super User
Super User

Create a measure


measure =
calculate(distinctcount(Table[Name]),filter(Table,DateDiff(Table[RefreshDate]; Table[ExchangeAct],day) = 0))


or create a column and measure


column = DateDiff(Table[RefreshDate]; Table[ExchangeAct],day)
measure =
calculate(distinctcount(Table[Name]),Table[Column] = 0)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Thanks! But this is not a little not that.

For example

Measure777.png

This user have a difference 1 day in 30.03.2020

And this means that it should be excluded. Must get users who have in every day difference = 0

You have created a column, That will not suppress row. Create a measure and use in visuals.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

I created a measure and use it like that.

This user should not be in result because he has difference  =1 in 30.03.2020 Measure888.png

az38
Community Champion
Community Champion

Hi @Anonymous 

try a measure

 

Measure = CALCULATE(DISTINCTCOUNT(Table[Name]); Table[ExchangeAct] = Table[RefreshDate]; DATESBETWEEN(Table[RefreshDate]; DATE(2020;3;25);DATE(2020;3;30)))

 


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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