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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
LAMLAM
Frequent Visitor

Show the Cummulative Count for all time, the past 12 months

Hi,

I am having a hard time figuring out how to create a measure that lets the end-user see the cummulative number of task created (for all time) for each of the past 12 months based on the current month selected in the filter. Feel free to add another supporting time dimension or whatever you need to make a measure that works. My cummulative base calculation looks like this and uses an inactive relationship. 

Cummulative Tasks Created = CALCULATE(
                                                     CALCULATE(
                                                          DISTINCTCOUNT(DimTask[TaskKey]);
                                                          USERELATIONSHIP(DimDate[Date];DimTask[Created]))
                                                     ;FILTER(ALL(DimDate);DimDate[Date]<=MAX(DimDate[Date])))

 

See picture below - all in red is the desired effect I wish to see.

example.pngYou can find the example file here: https://we.tl/t-tg65CIBN45

 

Best regards

 

 

1 ACCEPTED SOLUTION
LAMLAM
Frequent Visitor

I figured out the solution. Take a look below and like if you could use it for similar issues with cummulative measures and only showing a rolling window.

 

FinalMeasure =
Var measuree = CALCULATE(
                              CALCULATE(
                                  DISTINCTCOUNT(DimTask[TaskKey]);
                                       USERELATIONSHIP(DimDate[Date];DimTask[Created]))
                                  ;FILTER(ALL(DimDate);DimDate[Date]<=MAX(DimDate[Date])))
Var maxdate = LASTDATE('DimDate R12'[Date])
Var maxxdate = LASTDATE(DimDate[Date])
Var mindate = FIRSTDATE(DATEADD('DimDate R12'[Date];-11;MONTH))
Var tablee = SELECTCOLUMNS(
                        SUMMARIZE(
                             FILTER(ALL(DimDate);DimDate[Date] >= mindate && DimDate[Date] <= maxdate);
                             DimDate[Date]);
                       "Date";DimDate[Date];
                       "Count";measuree)
Var result = MAXX(FILTER(tablee;maxxdate=[Date]);[Count])

Return result

 

snip.PNG

View solution in original post

1 REPLY 1
LAMLAM
Frequent Visitor

I figured out the solution. Take a look below and like if you could use it for similar issues with cummulative measures and only showing a rolling window.

 

FinalMeasure =
Var measuree = CALCULATE(
                              CALCULATE(
                                  DISTINCTCOUNT(DimTask[TaskKey]);
                                       USERELATIONSHIP(DimDate[Date];DimTask[Created]))
                                  ;FILTER(ALL(DimDate);DimDate[Date]<=MAX(DimDate[Date])))
Var maxdate = LASTDATE('DimDate R12'[Date])
Var maxxdate = LASTDATE(DimDate[Date])
Var mindate = FIRSTDATE(DATEADD('DimDate R12'[Date];-11;MONTH))
Var tablee = SELECTCOLUMNS(
                        SUMMARIZE(
                             FILTER(ALL(DimDate);DimDate[Date] >= mindate && DimDate[Date] <= maxdate);
                             DimDate[Date]);
                       "Date";DimDate[Date];
                       "Count";measuree)
Var result = MAXX(FILTER(tablee;maxxdate=[Date]);[Count])

Return result

 

snip.PNG

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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