Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hello,
I am trying to retrieve [Days Between Incidents], grouped by the [Division]. Currently, I have [Days Between Incidents], without incorporation of the [Division]. I would like to be able to filter by Division for the report I create. I am having trouble with that, especially because I do not know the best solution.. whether to use measures or calculated columns.
This is what I currently have available:
Tables
Incidents - Shows Incident #, Date of the Incident, Date of Incident Filtered, and Division.
Previous Incident
DaysBTIncidents - Days Between Incidents, according to the Fiscal Date. This is the visualization to be shown.
FiscalCalendar - this table contains the Fiscal Dates, containg information such as Fiscal Month, Fiscal Year, Holiday Days, etc.
Relationships
I would like to obtain the [Days Between Incidents] measure, incorporating the Incidents[Division]... that means, for every division, there should be a new counter. Right now, when I filter by [Division], the numbers are the same for each, since the Previous Incident Date has no specified reference to the Division. What is the best way to do this? Are there DAX formulas that can be placed into a measure, optimizing performance? Or should I create a new table with calculated columns, that has every calendar date, and previous incident date per division?
Would really appreciate your advice!!
Solved! Go to Solution.
H @Anonymous,
You can try to use below measure to calculate previous incident date based on current incident index and division group:
Previous Incident Date = VAR _currIncident = SELECTEDVALUE ( 'Previous Incident'[Incidents] ) VAR _prevIncident = CALCULATE ( MAX ( 'Previous Incident'[Incidents] ), FILTER ( ALLSELECTED ( 'Previous Incident' ), 'Previous Incident'[Incidents] <= _currIncident ), VALUES ( 'Previous Incident'[Division] ) ) RETURN CALCULATE ( MAX ( 'Previous Incident'[Date] ), FILTER ( ALLSELECTED ( 'Previous Incident' ), 'Previous Incident'[Incidents] = _prevIncident ), VALUES ( 'Previous Incident'[Division] ) )
If above not help, please share some sample data for test and coding formula.
Regards,
Xiaoxin Sheng
H @Anonymous,
You can try to use below measure to calculate previous incident date based on current incident index and division group:
Previous Incident Date = VAR _currIncident = SELECTEDVALUE ( 'Previous Incident'[Incidents] ) VAR _prevIncident = CALCULATE ( MAX ( 'Previous Incident'[Incidents] ), FILTER ( ALLSELECTED ( 'Previous Incident' ), 'Previous Incident'[Incidents] <= _currIncident ), VALUES ( 'Previous Incident'[Division] ) ) RETURN CALCULATE ( MAX ( 'Previous Incident'[Date] ), FILTER ( ALLSELECTED ( 'Previous Incident' ), 'Previous Incident'[Incidents] = _prevIncident ), VALUES ( 'Previous Incident'[Division] ) )
If above not help, please share some sample data for test and coding formula.
Regards,
Xiaoxin Sheng
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
User | Count |
---|---|
91 | |
89 | |
79 | |
69 | |
68 |
User | Count |
---|---|
222 | |
128 | |
117 | |
82 | |
77 |