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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
to_be_calm
Helper I
Helper I

PowerBI Desktop visualization of 1000-man-quote and OSHA-rating. 1st works, 2nd not.

I have a problem with the visualization in PowerBI concerning the topic “accidents statistics” and I cannot explain why the visualization of the one quote works and the other not.

 

For explanation:

There are two different formulas, which are used. Europe still uses the 1000-man-quote for accidents statistics. Canada uses the OSHA-rating. The visualization of the “cumulated downtime” regarding “months of the year” works with the “1000-man-quote” but not with the “OSHA-rating” and I cannot explain why.

 

The 1000-man-quote is calculated as follows:

 

In general:

 

1000-man-quote = (Number of reportable occupational accidents x 1000 employees)/ (Number of full-time employees of the respective company)

 

I used the following DAX/Quickmeasure for calculating the 1000-man-quote:

 

thousandManQuote = DIVIDE(COUNTA('AccidentDB'[id]) * 1000, SUM('employees'[numberOfEmployees]))

 

In order to understand my visualization, I describe the PowerBI fields “cumulatedDowntime” and “accidentDateTime”.

 

The PowerBI field “cumulatedDowntime” is calculated with the following DAX code:

 

cumulatedDowntime =

CALCULATE(

    SUM('AccidentDB'[daysOff]),

    FILTER(

        CALCULATETABLE(

            SUMMARIZE(

                'AccidentDB',

                'AccidentDB'[accidentDateTime].[MonthNo],

                'AccidentDB'[accidentDateTime].[Monat]

            ),

            ALLSELECTED('AccidentDB')

        ),

        ISONORAFTER(

            'AccidentDB'[accidentDateTime].[MonthNo], MAX('AccidentDB'[accidentDateTime].[MonthNo]), DESC,

            'AccidentDB'[accidentDateTime].[Monat], MAX('AccidentDB'[accidentDateTime].[Monat]), DESC

        )

    )

)

 

Whereas the field “accidentDateTime is the datatype “Date” and has the format (dd.mm.yyyy). MonthNo is clear for a PowerBI Desktop user, I guess. I do not have to explain this.

 

The visualization of the “cumulatedDowntime" regarding the “months of the year” works with the 1000-man-quote. It uses for axis “accidentDateTime” and “month”. For values it uses of course “cumulatedDowntime”. The visualization graph type is "stacked column chart".

 

I want to have the same for the OSHA-rating, but PowerBI Dekstop does not show anything in the visualization “cumulatedDowntime” regarding the "months of the year" concerning the “OSHA-rate”. For the OSHA-rating I also use for axis “accidentDateTime”, “month” and for values “cumulatedDowntime”. The visualization graph type there is also "stacked column chart".

 

The aforementioned OSHA-rate is calculated with DAX as follows:

 

OSHA_Calculated = ROUND(DIVIDE([Quantity_Cumulated]*200000.0, [WorkHours_Cumulated]),2)

 

What could be the problem here? I am really stuck with it.

 

 

 

3 REPLIES 3
Greg_Deckler
Super User
Super User

@to_be_calm - Hard to say. Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
amitchandak
Super User
Super User

@to_be_calm ,Can you share sample data and sample output in table format?

@amitchandakI have found the solution. I got more detailed information about the table my calculations were based on and I did not have to parse the column days_off for the OSHA-rate, but another one. The thread can be deleted or closed. Thanks.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.