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
johnnoonan
Regular Visitor

Filters, All, AllSelected, AllExcept - Partitioning Data

I have been stuck on a problem for some time now and can't find a related issue in any of the forums.

 

I've tried to build out solutions with CALCULATE using FILTERs, ALL, ALLEXCEPT, ALLSELECTED, etc. but can't seem to make it work.

 

I need to have these calculated in a MEASURE, not in a calculated column.

I have a table which looks like this:

 

Date ProductSellerIdPercentOfTime
2020-01-01ABC2040%
2020-01-01ABC2255%
2020-01-01ABC135%
2020-01-01DEF2030%
2020-01-01DEF560%
2020-01-01DEF1310%
2020-01-02ABC2080%
2020-01-02ABC2220%

 

Basically, you can see that for each Date, Product, and SellerId combination, the total PercentOfTime makes up 100%.

 

I'm trying to get a table which looks like this (below), so I can aggregiate the data and generate the right charts, sorting, etc. Basically, I'm summing the PercentOfTime per SellerId per Date. This column (PercentOfTime_SUM) is easy to generate: it's basically a SUM in DAX, however, I need to be able to generate the Partition_Div column in order to be able to process further calculations.

 

The Partition_Div column will be the SUM of all PercentOfTime_SUM values partitioned by Date.

 

**The calculation column is here purely to aid the demonstration: it will not be generated on the UI or anywhere else.

 

Date SellerIdPercentOfTime_SUMPartition_DivCalculation of Partition_Div Result
2020-01-012070%200%70+55+15+6035%
2020-01-012255%200%70+55+15+6027.5%
2020-01-011315%200%70+55+15+607.5%
2020-01-01560%200%70+55+15+6030%
2020-01-022080%100%80+2080%
2020-01-022220%100%80+2020%

 

The objective is to be able to build all of these as measures so that I can divide the PercentOfTime_SUM by the Partition_Div (the Result column) and show the total percent of time each SellerId takes over an entire Date. In plain words, I should be able to say from above, as an example, that SellerId 20 took up 35% of the overall PercentOfTime on 2020-01-01.

 

I really hope I presented this well. Let me know if you have any questions.

1 ACCEPTED SOLUTION
dax
Community Support
Community Support

Hi @johnnoonan , 

You could refer to my sample for details.

Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
dax
Community Support
Community Support

Hi @johnnoonan , 

You could refer to my sample for details.

Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.