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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
MaxItaly
Helper III
Helper III

Cumulative passed days from smallest date

Hello everyone.

I have a "Subscriptions" table that has "User_id" column and "subscribe_date" Column.

I have a "Master Calendar" table with the "MasterDate" linked to "subscribe_date".

What I'd like to achieve (for using it in other formulas) is a line graph that shows the "subscribe_date" in the x axis and the cumulative passed days in the y-axis.

 

What should be the formula like?

I did something like

 

CumulativeDays =
CALCULATE(DATEDIFF(MINA('Subscriptions'[subscribe_date]); MAXA('Subscriptions'[subscribe_date]); DAY);
FILTER(ALLSELECTED('Master Calendar');
'Master Calendar'[MasterDate]<= MAX('Master Calendar'[MasterDate])))

 

but it's clearly not correct.

The formula should be equal to the number of days passed from the first subscription.

May someone please help me?

1 ACCEPTED SOLUTION
v-yulgu-msft
Employee
Employee

Hi @MaxItaly,

 

Please try this measure:

Passed days =
DATEDIFF (
    CALCULATE ( MIN ( Subscriptions[Subscription_date] ), ALL ( Subscriptions ) ),
    MAX ( Subscriptions[Subscription_date] ),
    DAY
)

Best 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.

View solution in original post

3 REPLIES 3
v-yulgu-msft
Employee
Employee

Hi @MaxItaly,

 

Please try this measure:

Passed days =
DATEDIFF (
    CALCULATE ( MIN ( Subscriptions[Subscription_date] ), ALL ( Subscriptions ) ),
    MAX ( Subscriptions[Subscription_date] ),
    DAY
)

Best 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.

Unfortunately it doesn't work:

Screenshot_1.png

I tried using both MasterDate and SubscribeDate as the x-axis.

It seems like it keeps taking the minimum value in the current selection and I don't understand why: the ALL() function should do the trick, isn't it?

 

Hi @MaxItaly,

 

Could you please post sample data and show us your desired output with examples?

 

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.