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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
dutchlimits
Helper I
Helper I

DAX headache: Divide not working in combination with filter

 

Hi dear community. 

 

I've been trying for hours, but I cannot seem to get the right results. I've had different results but my last attempt is in the screenshot. 

 

What i need to do is calculate a percentage based on hours. 

SICK HOURS / TOTAL HOURS * 100

 

The expected results are in the notepad below. 

 

I cannot attach the report because of privacy unfortunately. 

 

Column Tijdsregistraties["Dagen"] is a custom column with the following: Dagen = Tijdsregistraties[duur] / 60 / 60 / 1000 / 8

 

The sick hours is based on a column ProductRegistratie which contains the text "Ziek" it uses the same Dagen column but with this filter on it.

 

My attempt is: 

DagenZiektePercentagee =
var ziektedagen = CALCULATE(SUM(Tijdsregistraties[Dagen]);Tijdsregistraties[ProductRegistratie] = "Ziek")
var dagentotaal = SUM(Tijdsregistraties[Dagen])

return
ziektedagen / dagentotaal

 

 

Capture.JPG

1 ACCEPTED SOLUTION

Well maybe im stupid or need to learn more about PowerBI. 

 

Using a column with this DAX command was giving strange results.

 

After using a measure, it works perfectly... 

 

Why does this matter so much...? 

 

Anyway : this worked as a charm in a measure:

Dagentest = SUM(Tijdsregistraties[Dagen Ziek]) / SUM(Tijdsregistraties[Dagen Gewerkt]) * 100

View solution in original post

3 REPLIES 3
Greg_Deckler
Community Champion
Community Champion

Can you just click the little drop down arrow in the Fields area for your column and click Show as | Percent of Total?



Follow on LinkedIn
@ 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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Hi

 

Thanks for the suggestion, i tried that and that does not give me the expected results. The results should be seperately calculated from eachother per individual exactly like i showed in the notepad. 

 

I need to calculate per individual:

DIVIDE: SICK DAYS BY TOTAL WORK DAYS TIMES 100

Well maybe im stupid or need to learn more about PowerBI. 

 

Using a column with this DAX command was giving strange results.

 

After using a measure, it works perfectly... 

 

Why does this matter so much...? 

 

Anyway : this worked as a charm in a measure:

Dagentest = SUM(Tijdsregistraties[Dagen Ziek]) / SUM(Tijdsregistraties[Dagen Gewerkt]) * 100

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors