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
Kristofferaabo
Helper IV
Helper IV

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

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

 

 










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

6 REPLIES 6
v-yulgu-msft
Employee
Employee

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.

Hi @v-yulgu-msft
Yes they are coming from the same tables! One is just summarizing by 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.
danextian
Super User
Super User

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] )
)









Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

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] ))


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

 

 










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

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.