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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
jiexika24
Frequent Visitor

DAX Measure to Show % GT

Hello, I'm seeking edits to my DAX measure.

 

I have a pie chart showing whether participants prefer trainings (1) In-Person, (2) Online, (3) Hybrid, or (4) No Preference. In PowerQuery, I unpivoted the column ensuring to keep all rows, so the values could be blank, 1, 2, 3, or 4. I want to ignore the blanks and calculate the % of the GT for each.

 

However, when I built the pie chart, it's not showing the true data, which is (1) In-person with 1 count = 7.69%, (2) Online with 9 counts = 69.23%, (3) Hybrid with 1 count = 7.69%, and (4) No Preference with 2 counts 14.38% = 100%.

 

Below is the DAX measure that is returning wrong data. Please see image for the output.

 

Online/In-Person % of GT =
VAR NonBlankRowCount =
    CALCULATE(
        COUNTROWS('Table Name'),
        FILTER(
            'Table Name',
            NOT(ISBLANK('Table Name'[Online/In-Person Unpivoted Value]))
        )
    )
VAR DistinctValueCount = DISTINCTCOUNT('Table Name'[Online/In-Person Unpivoted Value])
RETURN
    DIVIDE(DistinctValueCount, NonBlankRowCount, 0) * 100
 
pie chart.png
 
Thanks for any suggestions!
1 REPLY 1
Anonymous
Not applicable

Hi, @jiexika24 

Can you provide some sample PBIX files? Based on your description, it's hard to model what your table will look like. Please be careful not to include private data.

 

How to Get Your Question Answered Quickly

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

Best Regards

Jianpeng Li

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.