cancel
Showing results for
Did you mean:

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

Helper I

## Count with data hierarchy occurrence

I have been asked to do a day and occurrence count, the only tricky thing about it is that it needs to look at a certain hierarchy it is the follwoing:

Manual black > manual red > model black > model red

So the highest hieararchy is manual black. Each one of them is a measure calculated in percentage of time. I'll create a table to hopefully give enough example data:

 Location Manual Black Model Black Manual Red Model Red Green ABC 4% 40% 56% DEF 1% 4% 10% 5% 80% GHI 51% 10% 39% JKL 1% 60% 39%

So, per the requirements, there should be the following in the counts:

2 days with manual black

1 day with manual red

1 day with model black.

To my understanding, an IF or SWITCH function may work, though how can I apply that to a hierarchy?

2 REPLIES 2
Community Support

So, per the requirements, there should be the following in the counts:
2 days with manual black

1 day with manual red

1 day with model black.

It would be helpful if you could elaborate on the computational logic behind these results, thanks.

Best Regards,
Gao

Community Support Team

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

Helper I

I'm not sure I understand your question. The results are just an example. I asume you meant how they are calculated.

They are calculated by a Divide formula, where it gets values from three columns. An overflow column, which says if it is overflown (automatic black) or green.

A manual status column, whether it is defined as red manual, black manual or none (green).

Then a system model where it will show if it is a predicted red or green.

Then the measures divide the instances on each based the number of rows by the total rows, some conditions are applied to avoid overlapping and match the hierarchy.

I hope I made sense to you explaining it