cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Dates between earlist date to latest date, but must account for country

Hi,

 

I would like to get the specific number of days between the first PSSV date and the latest SIV date for each country, as of now I can't get the country filter in so it takes the easliest date across all countries to the latest..

 

Can this be solved?

 

2018-04-26_16-04-15.jpg

1 ACCEPTED SOLUTION

Accepted Solutions
danextian New Contributor
New Contributor

Re: Dates between earlist date to latest date, but must account for country

Hi @Kristofferaabo,

 

Is what you are trying to achieve similar with the screenshot below? I used just the same formula. Here's a sample PBIX to check that it works: https://drive.google.com/open?id=10K511DhuNDOm8Xpic7TJBonhAWk_knA5

EARLIEST START LATEST END.png

 

 

"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
www.linkedin.com/in/danebelarminocpa

View solution in original post

6 REPLIES 6
danextian New Contributor
New Contributor

Re: Dates between earlist date to latest date, but must account for country

Hi @Kristofferaabo,

 

Try this DAX measure format

 

EARLIEST =
CALCULATE (
    MIN ( 'Table'[Date] ),
    ALLEXCEPT ( 'Table', 'Table'[Country Column] )
)

 

LATEST =
CALCULATE (
    MAX ( 'Table'[Date] ),
    ALLEXCEPT ( 'Table', 'Table'[Country Column] )
)
"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
www.linkedin.com/in/danebelarminocpa

Re: Dates between earlist date to latest date, but must account for country

Hi thanks for the reply! I tested this, but it still returns the highest and lowest across all my dates, and not by country..

EARLIEST PSSV =
CALCULATE (
MIN ( 'Site query'[pssv_date].[Date] ),
ALLEXCEPT ( 'Site query', 'Site query'[s.country_name] ))


danextian New Contributor
New Contributor

Re: Dates between earlist date to latest date, but must account for country

Hi @Kristofferaabo,

 

Is what you are trying to achieve similar with the screenshot below? I used just the same formula. Here's a sample PBIX to check that it works: https://drive.google.com/open?id=10K511DhuNDOm8Xpic7TJBonhAWk_knA5

EARLIEST START LATEST END.png

 

 

"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
www.linkedin.com/in/danebelarminocpa

View solution in original post

v-yulgu-msft Super Contributor
Super Contributor

Re: Dates between earlist date to latest date, but must account for country

Hi @Kristofferaabo,

 

Are the two [Country] columns highlighted in red coming from the same table or two separate tables?

 1.PNG

 

Regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Re: Dates between earlist date to latest date, but must account for country

Hi @v-yulgu-msft
Yes they are coming from the same tables! One is just summarizing by country

Highlighted
v-yulgu-msft Super Contributor
Super Contributor

Re: Dates between earlist date to latest date, but must account for country

Hi @Kristofferaabo,

 

I could not reproduce the problem on my side. Would you please share your .pbix file so that I can test for you?

 

Regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 58 members 1,032 guests
Please welcome our newest community members: