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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

Days since first case DAX

I would like to create some of the COVID-19 visualisations in Power Bi. So confirmed cases over time, but without using the date as the axis. I would like to use days since first case for each country.

 

Struggling to get the DAX for days since first case for each country

4 REPLIES 4
V-lianl-msft
Community Support
Community Support

Hi @Anonymous ,

 


@Anonymous wrote:

So confirmed cases over time, but without using the date as the axis. I would like to use days since first case for each country.

 

Struggling to get the DAX for days since first case for each country


Could you share the sample data to let us know your scenario better?

 

You could see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490 

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hi @V-lianl-msft  - So the table I am working with looks like this, and I am trying to recreate something almost similiar to the OurWorldInData visual shown here. I would like to know how I can calculate the days since 100th case. So for every day in the data set, we should know how many days since the first case for each country. 

image.png

 

image.png

Anonymous
Not applicable

You could probably do something like this 

 

 

Days since first case = int ( today() - firstdate(field with dates of cases))

 

 

Anonymous
Not applicable

Hi @Anonymous  - I tried this and it is not giving the desired result. Thank you

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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