Forum Discussion
dofrancis3
Resolver I
2 years agoMesure and Calendar table
Hi Colleagues! I've created a "Calendar" table, but when I try to create a measure, "Calenda table" doesn't appear. Could you help me to fixe this issue please. In other words, when I call up "Cal...
dofrancis3
Resolver I
2 years agoI would like to calculate the pourcentage of status without "blank dates" and pourcentage "include blank dates"
below is my Mesure:
below is my Mesure:
% Status = DIVIDE([NbrPass], [NbrStatus], 'Calendar'[Date] = BLANK())
Knowing that:
NbrPass = CALCULATE(COUNTROWS(repository),repository[STATUS]= "Pass")
NbrStatus = CALCULATE(COUNTROWS(repository),repository[STATUS]= "Pass"||repository[STATUS]= "Fail")
talespin
Solution Sage
2 years agohi dofrancis3 ,
This is what I used
----------------------------------------------------------------------------------------
Calendar table :
CALENDAR = CALENDAR("2023-01-01", "2024-12-31")
----------------------------------------------------------------------------------------
% Status without Blank Date =
VAR _TotalCount = CALCULATE( COUNT(FactTable[ID]), KEEPFILTERS(NOT(ISBLANK('CALENDAR'[Date]))) )
VAR _PassCount = CALCULATE( COUNT(FactTable[ID]), FactTable[Status] = "Pass" , KEEPFILTERS(NOT(ISBLANK('CALENDAR'[Date]))) )
RETURN DIVIDE( _PassCount, _TotalCount)
----------------------------------------------------------------------------------------
% Status with Blank Date =
VAR _SelYear = SELECTEDVALUE('CALENDAR'[YEAR])
VAR _TotalCount = CALCULATE( COUNT(FactTable[ID]) , REMOVEFILTERS('CALENDAR'[Date]), 'CALENDAR'[YEAR] = _SelYear || ISBLANK('CALENDAR'[YEAR]) )
VAR _PassCount = CALCULATE( COUNT(FactTable[ID]), FactTable[Status] = "Pass" , REMOVEFILTERS('CALENDAR'[Date]), 'CALENDAR'[YEAR] = _SelYear || ISBLANK('CALENDAR'[YEAR]))
RETURN DIVIDE( _PassCount, _TotalCount)
----------------------------------------------------------------------------------------