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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
DragonPhantom
New Member

Measure: Percent of locations that met a goal 0 or 100%

Hello, looking for some Dax help.

 

Per the title I am looking for Dax to find the percentage of locations that meet a goal of 4.5 average Google Rating. 0% if it was not reached and 100% if it was. The pivottable needs to be able to calculate the percentage of 0% and 100%'s on the Div Subtotal and GrandTotal lines. 

 

Data model consists of Google rating info similar to this table. Table name: "Google"

 

DivLocationReview SourcePostDateReview Rating
SMT0601-NWNGoogle5/24/2021 12:00:00 AM5
SMT0601-NWNFacebook5/24/2021 12:00:00 AM5
SMT0601-NWNYelp5/24/2021 12:00:00 AM5
SMT0601-NWNOur website5/24/2021 12:00:00 AM5

 

I have built a measure to find the average Review Rating that I plan to use in my PivotTable Quarter To Date Rating (QTD Rating):

 

QTD Rating:=ROUND(CALCULATE(AVERAGE(Google[Review Rating]), DATESQTD(Google[PostDate]), Google[Review Source]="Google"),1)

 

Using Div, Location, and QTD Rating in a pivottable the requested measure is the "Goal Met"

 

DivLocationQTD RatingGoal Met
BMT0201-WBF5.0100%
 0202-TBB4.6100%
 0203-ALP4.5100%
 0204-WHN4.5100%
 0205-NVI4.40%
 0206-GDC4.20%
 0207-TLR4.40%
 0208-FHN4.30%
 0209-GPF4.5100%
 0210-WWC4.6100%
 0211-SBY4.30%
 0212-MCB4.20%
 0213-SCS4.6100%
 0214-CTN4.40%
 0215-FTH4.30%
 0216-BFT4.8100%
 0217-WRW4.20%
 0218-DRO4.6100%
 0219-HTS4.6100%
 0220-BFH4.20%
 0221-TSL4.8100%
 0222-WYE4.00%
 0223-WRE4.40%
 0224-CTF4.5100%
 0225-DBN4.40%
 0226-RHS4.6100%
 0227-SGT4.10%
 0228-LKO4.30%
BMT Total 4.446%
PMT0101-PTS4.5100%
 0103-MTV4.8100%
 0104-BWS4.30%
 0105-SSV4.6100%
 0106-SDB4.6100%
 0107-BHP4.8100%
 0109-PDL4.6100%
 0111-CMT4.40%
 0112-HBR4.40%
 0113-BTB4.6100%
 0115-SNV4.9100%
 0116-LGN4.7100%
 0117-NOR4.20%
 0119-SMY4.30%
PMT Total 4.664%
SMT0110-MCD4.6100%
 0114-STK4.6100%
 0118-CVT4.5100%
 0120-CYR4.6100%
 0129-DLS4.5100%
 0601-NWN4.6100%
 0602-EPT4.8100%
 0604-FYT4.6100%
 0605-MRT4.9100%
 0606-PTC4.8100%
 0607-LGR4.8100%
 0608-CRL4.8100%
 0609-NWN4.7100%
SMT Total 4.7100%
Grand Total 4.564%

 

Thanks for any help!

 

1 ACCEPTED SOLUTION
DragonPhantom
New Member

I still haven't been able to find a suitable dax solution but I was able to build the requested PivotTable by grouping and outputting that dataset as a PivotTable as I illustrated. Thanks for the views and attempts!

View solution in original post

3 REPLIES 3
DragonPhantom
New Member

I still haven't been able to find a suitable dax solution but I was able to build the requested PivotTable by grouping and outputting that dataset as a PivotTable as I illustrated. Thanks for the views and attempts!

Anonymous
Not applicable

@DragonPhantom 

The measure [QTD Rating] will not work correctly. Please get familiar with time-intelligence in Power BI first to create formulas that will always work correctly. You can start with the documentation of the DATESQTD function.

Thanks for the input! For sake of reaching an answer we don't have to filter to any date period at all to get me on the right path. Then I can worry about ensuring accuracy over time.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors