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
fdkza
Frequent Visitor

Show Totals of categorised rows per month as percentage of a specific category of a row

Hi 

 

I have a dataset( see attached) . 

 

Dataset

 

The Table structure is 

 

Stagename(Category)TotalDate 
AValues A date (yyyy/mm/dd)
BValues A date (yyyy/mm/dd)
CValues A date (yyyy/mm/dd)
DValues A date (yyyy/mm/dd)
EValues A date (yyyy/mm/dd)

 

Each stagename is unique to a day in a month and I want to display it in a report as 

 

ABCDE
100%% of A % of A % of C% of D

 

I have connected the day of month to a dim_date table so ideally when the user selects a time frame this table changes, 

 

I have experimented with the following formula but that calculates against all. How do i adjust the measure to calculate against a particular date only

 

%Against = divide(CALCULATE(sum([total]),'dim_date'[db_date]),CALCULATE(sum([total]),[stagename] = "Accounts Created"))

Any help will be greatly appreciated 🙂 

3 REPLIES 3
v-frfei-msft
Community Support
Community Support

Hi @fdkza,

 

I made one sample for your reference.

 

1. Create a calculated column.

 

rank = RANKX(ALL(Sheet1),Sheet1[stagename],,ASC,Dense)

2. Create a measure as below.

 

Measure = 
VAR maxrank =
    CALCULATE ( MAX ( Sheet1[rank] ) )
VAR SUMA =
    CALCULATE (
        SUM ( Sheet1[total] ),
        FILTER ( ALLSELECTED ( Sheet1 ), Sheet1[rank] = maxrank - 1 )
    )
RETURN
    IF ( MAX ( Sheet1[rank] ) = 1, 1, CALCULATE ( SUM ( Sheet1[total] ) ) / SUMA )

Capture.PNG

For more details, please check the pbix as attached.

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Hi @v-frfei-msft

 

Thank you very much for this. I ideally want to display this using a date slicer at the top. How will i add the date to the measures ? 

 

Thanks for all your help so far! 

Hi @fdkza,

 

I cannot get you, Could you please share your excepted result to me?

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others 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.