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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
saranp780
Helper III
Helper III

How to create a measure for cumulative a line chart?

I have got data like this.....

 

StatusTitleName SurnameDeparmentLicense TypeAdding Date
ActiveMr.SusanSimonSaleOffice 365 Enterprise E316/9/2016
ActiveMr.TennassiKooSaleOffice 365 Enterprise E316/9/2016
ActiveMr.AndrewSundaenSaleOffice 365 Enterprise E317/9/2016

 

My requirement is to calculate from their license. If it is no longer licensed, the status will change to inactive.

 

The Active still show on the status means these licenses are available. and continue using. In this case, there are three data from 2016 in the table. I want to get 3 in 2016, 3 in 2017 and 3 in 2018. (follow this picture). 

 

Untitled.jpg

 Then if new user registration in 2019 increase 3 licenses It will be 6 licenses in 2019. (Not in this case)

Now I used this measure

Count of License Type RunningTotal By Adding Date = 
CALCULATE(
	COUNTA('Community'[License Type]),
	FILTER(
		ALLSELECTED('Community'[Adding Date]),
		ISONORAFTER('Community'[Adding Date], MAX('Community'[Adding Date]), DESC)
	)
)

 

And my result only shows 2016

line.jpg

 

Please give me an advice and suggest the measure that I have to do. Thank you all for your answer.

3 REPLIES 3
v-shex-msft
Community Support
Community Support

HI @saranp780,

 

Maybe you can use below measure to calculate available license amount based on calendar date:

Count of License Type RunningTotal By Adding Date =
VAR license_range = 24 //month amount
VAR calendar_date =
    SELECTEDVALUE ( calendar[Date] )
RETURN
    CALCULATE (
        COUNTA ( 'Community'[License Type] ),
        FILTER (
            ALLSELECTED ( 'Community'[Adding Date] ),
            calendar_date
                IN CALENDAR (
                    'Community'[Adding Date],
                    DATE ( YEAR ( 'Community'[Adding Date] ), MONTH ( 'Community'[Adding Date] ) + license_range, DAY ( 'Community'[Adding Date] ) )
                )
        )
    )

Notice: please use calendar date as axis and measure as value. 

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

I did it on you giving measure but the result can't display. Could you please, capture a screenshot? @v-shex-msft

HI @saranp780,

 

 

Can you please share a pbix file so I can test my formula with sample data?

 

Regards,

Xioaxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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