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

Group and Percent of Total

Lab.jpg

 

Hi, I need a help with something I thought would be easy.... In my column "Laboratorio" I have possible option and then I created two measure filtering each one, But I need this in the same measure...  and then have 200%... In Sql Server, I would do a query  grouping by "laboratorio" an then union with the other group. Does it make sense in power bi?

 

 

Thank you in advance!

1 ACCEPTED SOLUTION
FelipeDBA
Frequent Visitor

lab2.png

 

hi @AlB! I did it! I was looking for a whey to get 100% for each value in "laboratorio" column, (2 in my case) To achieve this, I calculated two measeures with the % of total as:

 

 

 

 

 

totalIP = 
VAR IP = [AdesoesIP]
Var totalIP = CALCULATE([AdesoesIP];ALLSELECTED('Compare'))
return
DIVIDE([AdesoesIP];totalIP)

 

and then I just simple sum both measures

 

MeasureTeste = [totalIP]+[totalPf]

 

and worked!

 

 

 

Thank you!

View solution in original post

3 REPLIES 3
AlB
Super User
Super User

Hi @FelipeDBA

 

Maybe if you show the code of your measure we can help. I do not exactly understand what you are trying to do.

A copy (sample) of your data model would also be very useful  

FelipeDBA
Frequent Visitor

lab2.png

 

hi @AlB! I did it! I was looking for a whey to get 100% for each value in "laboratorio" column, (2 in my case) To achieve this, I calculated two measeures with the % of total as:

 

 

 

 

 

totalIP = 
VAR IP = [AdesoesIP]
Var totalIP = CALCULATE([AdesoesIP];ALLSELECTED('Compare'))
return
DIVIDE([AdesoesIP];totalIP)

 

and then I just simple sum both measures

 

MeasureTeste = [totalIP]+[totalPf]

 

and worked!

 

 

 

Thank you!

Well done @FelipeDBA

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.