Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register 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 )
@Anonymous , Try a measure like
Divide(Count('Table'[id]),Calculate(Count('Table'[id]), allselected()),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
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
123 | |
78 | |
49 | |
38 | |
37 |
User | Count |
---|---|
196 | |
80 | |
70 | |
51 | |
42 |