Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi all. I was hoping someone might be able to help me with the required table structure/fields, relationships and DAX formulae needed in order to create a combo chart in Power BI that displays:
Please refer to the chart in the CASES – Calcs tab of the linked CASES.xlsx, which illustrates what I require.
The CASES and CASES_WITH_DUPLICATES tabs show two different tables I’ve used to try to calculate what I require.
I also have a separate date table as per the DATE tab which would be used for the date relationship.
The combo chart will need to be able to handle having its domain changed based on a date filter that users can choose in order to report on whatever date range they require, and the full table I’m using has other fields which will be used to splice the numbers further in other visualisations.
I’ve experimented using different permutations of formulae which include functions such as SUM, SUMX, FILTER, COUNTROWS, MIN, MAX, VALUES, ISONORAFTER, ALL, ALLSELECTED, etc. but I’m having no luck whatsoever.
Any help would be greatly appreciated, thank you!
Solved! Go to Solution.
@scott_m , Create a date table and create inactive joins with all your dates. Do not create active joins. and then use measure like below and use along with date table
Open Cases = CALCULATE(COUNT(Cases[CASE_NUMBER]),USERELATIONSHIP(Cases[DATE_CASE_RECEIVED],'Date'[Date]) )
Closes Cases = CALCULATE(COUNT(Cases[CASE_NUMBER]),USERELATIONSHIP(Cases[DATE_CASE_CLOSED],'Date'[Date]),not(ISBLANK(Cases[DATE_CASE_CLOSED])))
Current Cases = CALCULATE(COUNTx(FILTER(Cases,Cases[DATE_CASE_RECEIVED]<=max('Date'[Date]) && (ISBLANK(Cases[DATE_CASE_CLOSED]) || Cases[DATE_CASE_CLOSED]>max('Date'[Date]))),(Cases[CASE_NUMBER])))
Duplicate Active = CALCULATE(COUNT(Cases[CASE_NUMBER]),FILTER(Cases,Cases[DATE_CASE_RECEIVED]<=max('Date'[Date]) )) - CALCULATE(COUNT(Cases[DATE_CASE_CLOSED]),FILTER(Cases,Cases[DATE_CASE_RECEIVED]<=max('Date'[Date]) ))
@amitchandak this worked for the first three calculations, thank you so much!
However, the Duplicate Active calculation didn't result in the required values. What I've used instead to calculate this is:
@scott_m , Create a date table and create inactive joins with all your dates. Do not create active joins. and then use measure like below and use along with date table
Open Cases = CALCULATE(COUNT(Cases[CASE_NUMBER]),USERELATIONSHIP(Cases[DATE_CASE_RECEIVED],'Date'[Date]) )
Closes Cases = CALCULATE(COUNT(Cases[CASE_NUMBER]),USERELATIONSHIP(Cases[DATE_CASE_CLOSED],'Date'[Date]),not(ISBLANK(Cases[DATE_CASE_CLOSED])))
Current Cases = CALCULATE(COUNTx(FILTER(Cases,Cases[DATE_CASE_RECEIVED]<=max('Date'[Date]) && (ISBLANK(Cases[DATE_CASE_CLOSED]) || Cases[DATE_CASE_CLOSED]>max('Date'[Date]))),(Cases[CASE_NUMBER])))
Duplicate Active = CALCULATE(COUNT(Cases[CASE_NUMBER]),FILTER(Cases,Cases[DATE_CASE_RECEIVED]<=max('Date'[Date]) )) - CALCULATE(COUNT(Cases[DATE_CASE_CLOSED]),FILTER(Cases,Cases[DATE_CASE_RECEIVED]<=max('Date'[Date]) ))
User | Count |
---|---|
97 | |
87 | |
77 | |
67 | |
63 |
User | Count |
---|---|
111 | |
96 | |
96 | |
67 | |
63 |