- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

# Percentage of count of bands by total for the month

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

10-19-2017 03:31 AM

Hi

I have an order table that is connected to a DateDim and an already calculated value for the band of the number of days to completion.

Order | Completed_date_key | DaystoCompleteBand |

1 | 20170822 | <7 |

2 | 20170822 | <14 |

3 | 20170922 | <7 |

4 | 20170922 | <14 |

5 | 20171022 | <14 |

I was trying to create a measure as a percentage so that I could graph the counts by month.

Then when I use the DaystoCompletedBand in a slicer I would see the percentage of the total. So for August with no Band selected I would see 100% but if I select <7 then it would show 50%.

Perc = COUNT(ORDERS[ORDER])/CALCULATE(COUNT(ORDERS[ORDER], ALLEXCEPT(DATEDIM,DATEDIM[Month]))

This does not give me correct results but my DAX skills are basic.

Thanks in Advance.

Binway

Solved! Go to Solution.

Accepted Solutions

## Re: Percentage of count of bands by total for the month

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

10-19-2017 05:41 AM

If I understand correctly, you are trying to determine the percentage of orders within each band group. the formula below should help.

Please note that it is often easier to get the results you dersire from these % of parent calcs if your dimensional values, DaystoCompleteBand are in a dimension table rather than the fact.

Perc = COUNT(ORDERS[ORDER])/CALCULATE(COUNT(ORDERS[ORDER], all(ORDERS[DaystoCompleteBand]))

All Replies

## Re: Percentage of count of bands by total for the month

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

10-19-2017 05:41 AM

If I understand correctly, you are trying to determine the percentage of orders within each band group. the formula below should help.

Please note that it is often easier to get the results you dersire from these % of parent calcs if your dimensional values, DaystoCompleteBand are in a dimension table rather than the fact.

Perc = COUNT(ORDERS[ORDER])/CALCULATE(COUNT(ORDERS[ORDER], all(ORDERS[DaystoCompleteBand]))

## Re: Percentage of count of bands by total for the month

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

10-19-2017 04:42 PM

Works like a charm. I ended up creating a BAND Dim so that I could sort them as they are text and don't sort well.

So the report looks like this

With some data below to confirm the %'s

The DAX is

Perc = COUNT(ORDERS[ORDER])/ CALCULATE(COUNT(ORDERS[ORDER]), ALL(BANDS[Band]))

Thanks

Binway