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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
jfn
Frequent Visitor

Calculate Token usage since time reference

I would like to track software license usage. At contract signature, we are given a specific number of tokens to rent software at our convenience. I currently have all the tokens amount we have ordered, with dates, in my datasource. Sometime we rent multiple products in the same day.  How can I achieve a panel that would show the remaining number of tokens in our contract?

Here an example:

DateToken usedRemaining tokens
January 1, 2021100400
January 10, 202150350
January 10, 202125325
January 20, 2021200125
   
Token on contract500 
   
   
Bluein MySQL 
RedNeeds to be in PowerBI 

 

 

 

1 ACCEPTED SOLUTION
ChrisMendoza
Resident Rockstar
Resident Rockstar

@jfn -
You can do as:

image.pngimage.pngimage.png






Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

Proud to be a Super User!



View solution in original post

7 REPLIES 7
ChrisMendoza
Resident Rockstar
Resident Rockstar

@jfn -
You can do as:

image.pngimage.pngimage.png






Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

Proud to be a Super User!



Thanks @ChrisMendoza , I think this is working... But my line chart show the slope the wrong way...? I should start with the full amount and then start going down... Any idea?

 

jfn_0-1663342815989.png

 

 

jfn
Frequent Visitor

Actually, the RemainingTokens column reverts to the full amount when there's no credit being used... I need to find a way to use the remaining tokens from previous row... 

Screenshot 2022-09-16 120521.JPG

@jfn - I feel like I don't have enough understanding of your data model to replicate your issue as my example outputs as I would expect. I recommended reviewing the pattern/technique described at Computing running totals in DAX - SQLBI which is what I've used in this solution with my sample data. If you would like assistance with your data/.pbix you'll need to include as such.


image.png

Find the attached .pbix file for your review.






Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

Proud to be a Super User!



@ChrisMendoza, I'm currently reviewing the link you sent as well as your PowerBI file. For reference, here's a link to my PowerBI file... https://ksheng-my.sharepoint.com/:u:/g/personal/jfn_ksh_ca/EdJSoV9sAJ1Ag6BD8J-9Nt4BQLCGQA36DyjU9NvEC... 

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
jfn
Frequent Visitor

ok, It seems to work now... I just needed to change the setting for the date; from Date Hierarchy to StartDate... Now I just need to find how to generate a date for each day (not skipping any date)...Capture.JPGCapture.JPG

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.