Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!
Hi everyone,
I has a table below:
To calculate percent like table below:
Normally I will create many Measure for each "Source" like below:
%Internet/Website = DIDIVE(Calculate(Count('Table'[id]), 'Table'[Source] = "Internet/Website"), Count('Table'[id]),0)
%Friend = DIDIVE(Calculate(Count('Table'[id]), 'Table'[Source] = "Friend"), Count('Table'[id]),0)
........
If i have 10 Sources --> need create 10 measures to calculate percent for each. So, have any solution for create only 1 measure to calculate percent for each "Source" ?
Thank you for reading.
Solved! Go to Solution.
@Anonymous , Try a measure like
Divide(Count('Table'[id]),Calculate(Count('Table'[id]), allselected()),0 )
@Anonymous , in that case try like
Divide(Count('Table'[id]),Calculate(Count('Table'[id]), allselected(Table[Sources])),0 )
or
Divide(Count('Table'[id]),Calculate(Count('Table'[id]), removefilter(Table[Sources])),0 )
or
Divide(Count('Table'[id]),Calculate(Count('Table'[id]), filter(allselected(Table),Table[Date] =max(Table[Date]) )) ,0 )
@amitchandak It work, but I have one more question.
When I applied it with a column group by Date, the results like below pictures:
With column: No.50.....
Total in this column is 23, marketing campaign = 7 --> % should be 7/23 *100. But now, It will divide to total is 97.
Any solution for this case sir?
@Anonymous , in that case try like
Divide(Count('Table'[id]),Calculate(Count('Table'[id]), allselected(Table[Sources])),0 )
or
Divide(Count('Table'[id]),Calculate(Count('Table'[id]), removefilter(Table[Sources])),0 )
or
Divide(Count('Table'[id]),Calculate(Count('Table'[id]), filter(allselected(Table),Table[Date] =max(Table[Date]) )) ,0 )
Thank you sir. I got it
The Power BI Data Visualization World Championships is back! It's time to submit your entry.
| User | Count |
|---|---|
| 130 | |
| 129 | |
| 59 | |
| 48 | |
| 47 |