Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Solved! Go to Solution.
Hi @meirlicht ,
You can optimize your Dax performance with this code:
Distinct Count of Price 2.0 =
CALCULATE (
COUNTROWS ( DISTINCT ( 'SalesData'[Unit Price] ) ),
ALLEXCEPT ( 'SalesData', 'SalesData'[Code], 'SalesData'[Store] )
)
Final output:
How to Get Your Question Answered Quickly - Microsoft Fabric Community
If it does not help, please provide more details with your desired out put and pbix file without privacy information.
Best Regards,
Ada Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @meirlicht ,
Based on the information you provided, you can follow these steps:
1. Change your measure.
Distinct Count of Price 2.0 =
COUNTAX (
FILTER (
ALL ( 'SalesData' ),
'SalesData'[Code] = SELECTEDVALUE ( SalesData[Code] )
),
'SalesData'[Unit Price]
)
Final output:
How to Get Your Question Answered Quickly - Microsoft Fabric Community
If it does not help, please provide more details with your desired out put and pbix file without privacy information.
Best Regards,
Ada Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello Ada, the issue with the measure you provided is it returns count rather than distinct count, but it helped guide me on the right path to the following measure. (I also included the store filter in the measure)
Distinct Count of Price 2.0 =
CALCULATE (
DISTINCTCOUNT ( 'SalesData'[Unit Price] ),
FILTER (
ALL ( 'SalesData' ),
'SalesData'[Code] = SELECTEDVALUE ( SalesData[Code] )
&& 'SalesData'[Store] = SELECTEDVALUE ( SalesData[Store] )
)
)
Is there a more efficient way to do this? It is taking a long time to load in my matrix.
Thank you so much for your time!
Hi @meirlicht ,
You can optimize your Dax performance with this code:
Distinct Count of Price 2.0 =
CALCULATE (
COUNTROWS ( DISTINCT ( 'SalesData'[Unit Price] ) ),
ALLEXCEPT ( 'SalesData', 'SalesData'[Code], 'SalesData'[Store] )
)
Final output:
How to Get Your Question Answered Quickly - Microsoft Fabric Community
If it does not help, please provide more details with your desired out put and pbix file without privacy information.
Best Regards,
Ada Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
90 | |
89 | |
79 | |
70 | |
68 |
User | Count |
---|---|
226 | |
129 | |
119 | |
84 | |
77 |