Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hey everyone,
I couldn't solve a problem so I decided to ask for your help.
Currently, I am dealing with a data that has user names, and a certification type that is associated to each user. A certificate is only valid between specific dates (i.e. 05 March 2019-14 September 2023). Also, there are 5 types of certificates.
I would like to draw a graph showing the cumulative sum of certificates available at the beginning of each month, with a certificate type breakdown. I tried to write a formula to calculate the cumulative sum, yet it is not dynamic adjusting the cumulative sum with respect to changing range of x-axis; which is the date in my case.
Have you formulized such a problem before? If so, I would really appreciate your help.
Kind Regards,
Murat
// Fact: Certification Info
// Dimensions with the type of connection:
// User 1:* Certification Info
// Certificate 1:* Certification Info
// Date (not connected to Certification Info)
// Certificate Type must be the attribute of Certificate
// and not be stored int the fact table.
//
// Assumptions:
// Date should be a Date table in the model.
// UI slicing only through dimensions.
// All columns in the fact table are hidden.
// This measure will grab the very first date
// visible in the currently selected period,
// (if you select jan 2020, it'll be
// 1st jan 2020) and calculate the number
// of certificates that were valid on this
// very day.
//
// If you connect Date to the fact table,
// this formula should be written differently.
// Here, the assumption is that no column in
// the fact table is exposed to the user. This
// is how it should be. If you decide to have
// a calendar connected to either of the fields,
// ValidFrom, ValidTo, the formula will not
// work correctly.
[# Cert At Period Start] =
var __firstDate = FIRSTDATE( Date[Date] )
var __certCount =
CALCULATE(
COUNTROWS( 'Certification Info' ),
'Certification Info'[ValidFrom] <= __firstDate,
'Certification Info'[ValidTo] >= __firstDate
)
return
__certCount
It's easy to get this measure by Cert Type and Periods (be it months or years or... whatever you define in Date). Just drag the attribute from the Certificate dimension onto somewhere....
Best
D
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
25 | |
19 | |
18 | |
18 | |
17 |
User | Count |
---|---|
34 | |
25 | |
18 | |
16 | |
13 |