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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
pineapple77
Frequent Visitor

DAX formula for percentage with filter

Hello,

 

I have stucked on that DAX formula and i would love to get some help 🙂 

I want to visualise a percentage from the total of the same column.

I need the first value of the same column filtered to divide it to the original value of the same column, multyplied by 100 to get percentage.

I used CROSSFILTER and some other functions but i couldn't come up with a result.

 

I made a measure of the original value so i ca use it and called it "Percentage" and made a Crossfilter that looks like this but it doesn't work (" Percentage2 = CALCULATE([Percentage]; CROSSFILTER('Diversion_type (done)'[Weight];'_Diversions 2017/09'[Number];OneWay)) ")

 

Thank you!

 

Best Regards,

Pavlin Ivanov

2 REPLIES 2
v-sihou-msft
Employee
Employee

@pineapple77

 

Can you share some sample data? 

 

In this scenario, if you just need to calculate the percent to total for current row value, you just need to specify ALLSELECTED() as filter to get the total. So your percentage measure can be like: 

 

Percentage=SUM([Measure])/CALCULATE([Measure],ALLSELECTED(Table))

Regards,

Diversion (COUNT).pngDiversion (WEIGHT).png

Hello,

Here is some sample data.

The column that i have to filter is located in (Diversions 09/2017) [Count] and i have to filter it by (Diversion Weight) [weight] which column is in another table. I have to get the SUM of [count] before the filter and the SUM of [count] after the filter.
Can i get the values this way or if you can give a tip how to do it another way.

 

Thank you,

Pavlin Ivanov

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.