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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

DAX

Hi,

 

I've made an analysis on COVID - 19 wherein I want to analyze how frequently the cases are getting doubled (in Days) and by what factor it has been doubled. This is the DAX expression I've written but the thing is I'm getting a no. of days different in compariosn with the days shown over the internet. 

 

DoublingTime Cases =

VAR CurrentDay =
MAX('full_data (6)'[date] )

VAR ThresholdValue =
CALCULATE(SUM( 'full_data (6)'[new_cases] ) , 'full_data (6)'[date] = CurrentDay ) / 2

VAR DayOfHalf =
CALCULATE (
MAX ( 'full_data (6)'[date] ),
FILTER (
ADDCOLUMNS (
SUMMARIZE ( ALL ( 'full_data (6)' ), 'Date'[Date] ),
"No_Of_Days", CALCULATE ( SUM ( 'full_data (6)'[new_cases] ) )
),
[No_Of_Days] <= ThresholdValue
)
)

VAR DoublingTime = ( CurrentDay - DayOfHalf ) * 1
 
VAR Result =
IF ( AND ( DoublingTime < 10000, DoublingTime > 0), DoublingTime )
RETURN
Result
 
But the thing is in my DAX it is selecting the whole time frame since the virus spread and also the Factor kept is constant as 2 whereas I would like to know that in just how many days the virus got doubled and by the actual factor. 
 
For Example - The total no. of cases increased by a factor 2.3 in the last 28 days. 36 Cases on March 22 and 82 Cases on April 19.
 
Please help me with the DAX.
 
Thanks & Regards,
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Please find a solution in the attached file.

 

Best

D

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Please find a solution in the attached file.

 

Best

D

Anonymous
Not applicable

Hi @Anonymous ,

 

I'm not able to open the file it shows as pr the screen shot provided below - 

 

 

Screen Shot.PNG

Please provide me an alternative. Really appreciate you help here.

 

Thanks

Anonymous
Not applicable

I could download and it opens without a hitch. Update your PBI Desktop to the latest version.

Best
D
Anonymous
Not applicable

"and by what factor it has been doubled"

I'm afraid that when something has been doubled, then the factor is 2.

Best
D

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.