The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi guys,
I am a green hand, just met a problem that I would like to get a help . I don't calculate the %GT sum of reg during whole period like below, I want to calculate by day, for exampler how much of percentage of affiliates share in 1/7 (100%), how should I write the dax ?
Solved! Go to Solution.
Hi @clarafff ,
Create measure.
Percentage of affiliates per day:
Measure_affiliates =
var _count=COUNTX(FILTER(ALL('Table'),'Table'[REFERENCE_DATE]=MAX('Table'[REFERENCE_DATE])),[ACQUISITION_CHANNEL])
var _countaffiliates=COUNTX(FILTER(ALL('Table'),'Table'[REFERENCE_DATE]=MAX('Table'[REFERENCE_DATE])&&'Table'[ACQUISITION_CHANNEL]="affiliates"),[ACQUISITION_CHANNEL])
return
DIVIDE(
_countaffiliates,_count)
Measure_group =
var _count=COUNTX(FILTER(ALL('Table'),'Table'[REFERENCE_DATE]=MAX('Table'[REFERENCE_DATE])),[ACQUISITION_CHANNEL])
var _countgroup=COUNTX(FILTER(ALL('Table'),'Table'[REFERENCE_DATE]=MAX('Table'[REFERENCE_DATE])&&'Table'[ACQUISITION_CHANNEL]=MAX('Table'[ACQUISITION_CHANNEL])),[ACQUISITION_CHANNEL])
return
DIVIDE(
_countgroup,_count)
Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @clarafff ,
Create measure.
Percentage of affiliates per day:
Measure_affiliates =
var _count=COUNTX(FILTER(ALL('Table'),'Table'[REFERENCE_DATE]=MAX('Table'[REFERENCE_DATE])),[ACQUISITION_CHANNEL])
var _countaffiliates=COUNTX(FILTER(ALL('Table'),'Table'[REFERENCE_DATE]=MAX('Table'[REFERENCE_DATE])&&'Table'[ACQUISITION_CHANNEL]="affiliates"),[ACQUISITION_CHANNEL])
return
DIVIDE(
_countaffiliates,_count)
Measure_group =
var _count=COUNTX(FILTER(ALL('Table'),'Table'[REFERENCE_DATE]=MAX('Table'[REFERENCE_DATE])),[ACQUISITION_CHANNEL])
var _countgroup=COUNTX(FILTER(ALL('Table'),'Table'[REFERENCE_DATE]=MAX('Table'[REFERENCE_DATE])&&'Table'[ACQUISITION_CHANNEL]=MAX('Table'[ACQUISITION_CHANNEL])),[ACQUISITION_CHANNEL])
return
DIVIDE(
_countgroup,_count)
Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
thanks! I got inspired by your dax.
@clarafff , % of Grand
Divide([Measure], calculate([Measure], allselected()) )
Or Sub Total
Divide([Measure], calculate([Measure], Filter(allselected(Table), Table[Day] = max(Table[Day]) ) )
If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
User | Count |
---|---|
26 | |
12 | |
8 | |
7 | |
5 |
User | Count |
---|---|
28 | |
13 | |
12 | |
12 | |
6 |