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.
Hi Guys, i need convert this SQL to DAX, but i can't do it. I tryed several DAX, but i found several errors.
SQL:
SELECT NFS,COUNT(CPF) AS PESSOAS FROM
(
SELECT CL.CPF AS CPF,COUNT(FT.NOTA_FISCAL) as NFS FROM FT_FATURAMENTO AS FT
INNER JOIN DM_CLIENTE AS CL ON CL.SK_CLIENTE = FT.SK_CLIENTE
GROUP BY CL.CPF
)AS TEMP
GROUP BY NFS
ORDER BY 1
I need a result like this:
Number of clients who bought 1 turn -------1 client
Number of clients who bought 2 turn -------10 client
Hi @Anonymous ,
Could you share me some sample data and your expected result? Then I can test for you directly.
Reference: How to provide sample data in the Power BI Forum - Microsoft Power BI Community
Best Regards,
Icey
@Anonymous , You are looking for bucketing /binning. When a measure {COUNT(FT.NOTA_FISCAL) } is converted dimension using an independent table
refer these if, that can help you
https://www.daxpatterns.com/dynamic-segmentation/
https://radacad.com/grouping-and-binning-step-towards-better-data-visualization
https://youtu.be/CuczXPj0N-k
Create a measure of the count. Create a table with counts (Generateseries), Create a measure with CPF on the group by /values. Use = join with this new series table to get the correct value.
Similar step is there for range in video, link 3
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 |
---|---|
85 | |
42 | |
30 | |
27 | |
27 |