Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
VGuichard
Frequent Visitor

Summarize without rows in fact table

Hello,

 

I'm working with data from a ticketing tool. For each location, I have a some tickets and for each ticket, a number of service unavailabity.

 

For each location, I need to calculate the rate of availabity with this formulas :

(Number of hours in the month - Number of Hours on unavailability) / Number of hours in the month

VGuichard_0-1644241463356.png

For example in janv-21 : 31 days => 31*24 = 744 hours 

Rate of availability => (744 - 257.81)/ 744 = 65.35 %  

For information, in the DimDate, I add the numbers of hours in each month

And finally for all the year, the rate of availabilty is 44,27 %

 

But It is wrong because in february/may/june& november, I haven't ticket in the fact table, so the rate of availability for these 4 months must be 100 %  (AND NOT BLANK...) . So my global KPIs (for one year) and for the "Location1" must be :

VGuichard_1-1644241752049.png

 

For information? I need to display the global "RateOfAvailability" for all location (average of rate of availability per location) and the repartition per month. Also I have a lot of slicer, so we can not use a table with DAX.

VGuichard_2-1644242634109.png

 

I try with SUMMARIZE, but as I don't have rows for some couples "Location/Month" in the fact table, the measure is false :

RateOfAvailability% =
            AVERAGEX(
                          SUMMARIZE(Fact_ServiceRequest
                         ,Dim_ServiceTicket[X_NOM_COURT_ADRESSE]        --Location
                         ,Dim_Date[MoisAnnéeInt]
                        ,"RateOfAvailability%",IF(countrows(F_Incident)=0
                             ,1
                             ,DIVIDE(MAX(D_Date[NbJourMois])*24-SUM(F_Incident[X_TPS_INDISPO]),MAX(D_Date[NbJourMois])*24)
                          )
           ,[TpsIndispo%]
           )
 
Thanks you for your help
 
 

 

4 REPLIES 4
v-janeyg-msft
Community Support
Community Support

@VGuichard  Any updates?

VGuichard
Frequent Visitor

Thank you Amitchandak, but I don't understand what you want to calculate.

 

My query work for the month with data in fact table (I upddated the query with good name 🙂 😞 

 

RateOfAvailability% =
            AVERAGEX(
                          SUMMARIZE(Fact_ServiceRequest
                         ,Dim_ServiceTicket[X_NOM_COURT_ADRESSE]        --Location
                         ,Dim_Date[MoisAnnéeInt]
                        ,"RateOfAvailability%",IF(countrows(Fact_ServiceRequest)=0
                             ,1
                             ,DIVIDE(MAX(D_Date[NbDaysByMonth])*24-SUM(Fact_ServiceRequest[Nb_Of_Hours_Unavailable]),MAX(D_Date[NbDaysByMonth])*24)
                          )
           ,[RateOfUnavailability%]
           )
 
The question is how to date the month without Ticket (100 % of avaibility by defaut)
 
Thanks

Hi, @VGuichard 

 

I didn't understand your question, do you want to show 100% in the bar chart? And is the value in the card visual correct? What's the difference between your current result and your desired result?

vjaneygmsft_1-1644481248155.png

 

Janey

 

amitchandak
Super User
Super User

@VGuichard ,  Try a measure like

available Hours 

sumx(values('Date'[Month Year]),day(max(fact[Date]))*24 )

 

or

 

sumx(values('Date'[Month Year]),day(eomonth(max(fact[Date]),0) )*24 )

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.