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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

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
Microsoft Employee
Microsoft 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
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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