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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
clarafff
Frequent Visitor

How to calculate the %grand total by day

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 ? 

clarafff_0-1667559136124.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

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:

vyangliumsft_1-1667805749347.png

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

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

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:

vyangliumsft_1-1667805749347.png

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.

% grand of total REG =
var test1 = CALCULATE(sum('table'[REG]),FILTER(ALL('Fact_Aquisition channel'),'tablel'[REFERENCE_DATE]=MAX('table'[REFERENCE_DATE])))
var test2 = CALCULATE(SUM('table'[REG]),FILTER(ALL('table'),'table'[REFERENCE_DATE]=Max('table'[REFERENCE_DATE])&&'table'[ACQUISITION_CHANNEL]=MAX('table'[ACQUISITION_CHANNEL])))
return
DIVIDE(test2,test1)
amitchandak
Super User
Super User

@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.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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