Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
Hello all
Please could I get some assistance figuring out some syntax which eludes me - I've read and tried many things but am stuck.
I have a table (PostcodeDemog) which contains UK postcode data. For each postcode there is a demographics field too, something like this -
Postcode, DemoCat
AB1 2AB, aaa
AB1 3AB, aaa
AB1 4AB, bbb
AB1 5AB, --- // these are reserved postcodes
AB1 6AB, --- // with no democat available
I need a chart which has a distinctcount of PostCodes on one axis, with the DemoCat value on the other axis.
This is easy enough of course. But I need this chart -
I'm trying to make a measure that includes this logic, but I cannot get the syntax right... I am trying to get some combination of the following:
Hoping someone can help me out.
Many thanks
Jeff
Hi @jeffhickman,
Please try to use below dax measure formula if it suitable for your requirement:
Measure =
CALCULATE (
DISTINCTCOUNT ( 'PostcodeDemog'[PostCode] ),
FILTER ( ALL ( 'PostcodeDemog' ), PostcodeDemog[DemoCat] <> "---" )
)
Regards,
Xiaoxin Sheng
Hello - thanks so much for your reply. I no longer get a syntax error in my measure, but the chart is showing the same value for everything on the DemoCat axis - it's showing the grand total of the measure on all bars, rather than the measure per DemoCat.
I wonder if you can help a bit further?
Many thanks
Jeff
HI @jeffhickman,
I'd like a pbix file with some sample data for test, it will be help for coding formula on your scenario.(you can upload to onedrive or google drive then share link here, remember do mask on sensitive data)
Regards,
Xiaoxin Sheng
Thanks again for staying with me - I'll get a pbix uploaded as soon as I can. Bear with me, I haven't forgotten but it'll take me a little while to create an example with no real data in it.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 76 | |
| 37 | |
| 31 | |
| 27 | |
| 27 |