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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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