Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi,
I referred to couple links https://community.powerbi.com/t5/Desktop/Calculate-open-tickets-at-the-end-of-the-month/m-p/311142/h...
My requirement is the same.But i am doing this in the ssas tabuar model.I already have a role playing date dimenison in my model,hence i cannot use your solution where you create a calculated date table.
Pls provide a solution for tabular model where it could be acheived as a measure.
I have attached a sample data and expected output file.
So far,I was have been able to create 2 measure called EOMNEw(count of new tickets open each month) ,EOMClosed (count of closed tickets each month) and Open (subtract EOMNEw and EOMClosed).Open does not depict the correct numbers though,we need to compute Open using EOMNEw/EOMClosed.
EOMNEw =
CALCULATE (
DISTINCTCOUNT ( [ID] ),
FILTER (
Internal,
(
Internal[CloseDate] = BLANK ()
|| Internal[CloseDate] > EOMONTH ( [OpenDate], 0 )
)
&& Internal[OpenDate] <= MAX ( 'Date'[Date] )
)
)
EOMClosed =
CALCULATE (
DISTINCTCOUNT ( Internal[ID] ),
USERELATIONSHIP ( Internal[CloseDate], 'Date'[Date] )
)
Open =
CALCULATE (
DISTINCTCOUNT ( [id] ),
FILTER (
ALL ( Internal ),
(
Internal[CloseDate] = BLANK ()
|| Internal[CloseDate] > EOMONTH ( [OpenDate], 0 )
)
&& Internal[FirstDate] <= MAX ( 'Date'[Date] )
)
)
- CALCULATE (
DISTINCTCOUNT ( [id] ),
USERELATIONSHIP ( Internal[CloseDate], 'Date'[Date] )
)
Solved! Go to Solution.
Hi @Anonymous,
One measure could be enough. Please refer to the demo in the attachment that is based on your data here.
Measure = CALCULATE ( SUMX ( ADDCOLUMNS ( SUMMARIZE ( Internal, 'Date'[Date].[Year], 'Date'[Date].[Month] ), "MonthlyTotal", CALCULATE ( DISTINCTCOUNT ( Internal[ID] ) ) - CALCULATE ( DISTINCTCOUNT ( Internal[ID] ), USERELATIONSHIP ( 'Date'[Date], Internal[CloseDate] ) ) ), [MonthlyTotal] ), FILTER ( ALL ( 'Date'[Date] ), 'Date'[Date] <= EOMONTH ( MAX ( 'Internal'[OpenDate] ), 0 ) ) )
Best Regards,
Dale
Hi @Anonymous,
One measure could be enough. Please refer to the demo in the attachment that is based on your data here.
Measure = CALCULATE ( SUMX ( ADDCOLUMNS ( SUMMARIZE ( Internal, 'Date'[Date].[Year], 'Date'[Date].[Month] ), "MonthlyTotal", CALCULATE ( DISTINCTCOUNT ( Internal[ID] ) ) - CALCULATE ( DISTINCTCOUNT ( Internal[ID] ), USERELATIONSHIP ( 'Date'[Date], Internal[CloseDate] ) ) ), [MonthlyTotal] ), FILTER ( ALL ( 'Date'[Date] ), 'Date'[Date] <= EOMONTH ( MAX ( 'Internal'[OpenDate] ), 0 ) ) )
Best Regards,
Dale
Dale,
Thank a ton!!
This approach works,however,there is 1 thing that i want to do.If i slice this by Location[SiteName] it doesnt group by the sites instead gives me some wrong values.The Location dimension has SiteID,Sitename,RegionID,Regionname columns and joined to Internal table with SiteID.When i slice by Sitename from Location,it goves me some junk values.But overall the count per month,per year is correct.
Pls guide.
Attached the screenshot.
Hi @Anonymous,
Maybe you can add more parameters to the SUMMARIZE. If you want a more detailed solution, I would suggest you open a new thread in this forum with some sample data.
Measure = CALCULATE ( SUMX ( ADDCOLUMNS ( SUMMARIZE ( Internal, 'Date'[Date].[Year], 'Date'[Date].[Month], Internal[Site Name] ), "MonthlyTotal", CALCULATE ( DISTINCTCOUNT ( Internal[ID] ) ) - CALCULATE ( DISTINCTCOUNT ( Internal[ID] ), USERELATIONSHIP ( 'Date'[Date], Internal[CloseDate] ) ) ), [MonthlyTotal] ), FILTER ( ALL ( 'Date'[Date] ), 'Date'[Date] <= EOMONTH ( MAX ( 'Internal'[OpenDate] ), 0 ) ) )
Best Regards,
Dale
Dale, I opened a new thread here: https://community.powerbi.com/t5/Developer/summarize-by-site-did-not-return-correct-results/m-p/4885... Please look into it and help me with it.I am stuck at that point.
I would open new thread.
User | Count |
---|---|
15 | |
2 | |
1 | |
1 | |
1 |
User | Count |
---|---|
18 | |
11 | |
5 | |
4 | |
3 |