Join 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!The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!
I have two Power BI reports, built in Desktop and now up and running in Service, both of them are since 24 of November 2023 not working due to a measure = DISTINCTCOUNT(Customer_Id). My other measures are working fine, and the DISTINCTCOUNT works if I switch to Import Mode, however this is not something I wan't due to the size of the datamodel. The DISTINCTCOUNT have worked just fine i DirectQuery mode before but recently (since 24 Nov 2023) are not working.
I get the following message in PBI Service in the visuals where the DISTINCTCOUNT is present.
"Expression.Error: We couldn't fold the expression to the data source. Please try a simpler expression.. ;We couldn't fold the expression to the data source. Please try a simpler expression.. The exception was raised by the IDbCommand interface."
Does anyone know the problem? Does it have something to do with the latest update?
//Jesper
Solved! Go to Solution.
Problem was formating of the column in the native database, even if Power BI managed to convert the column to a decimal number the distinctcount function didn't work. After changes to the formatting av Customer_Id in our native database the problem was solved.
Problem was formating of the column in the native database, even if Power BI managed to convert the column to a decimal number the distinctcount function didn't work. After changes to the formatting av Customer_Id in our native database the problem was solved.
pls try this
SUMX(VALUES(Customer_Id),1)
OR
SUMX(DISTINCT(Customer_Id),1)
Thanks, but unfortunately same problem, seems to be to complex for DirectQuery mode.
The Power BI Data Visualization World Championships is back! It's time to submit your entry.
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 56 | |
| 42 | |
| 40 | |
| 21 | |
| 21 |
| User | Count |
|---|---|
| 149 | |
| 105 | |
| 63 | |
| 36 | |
| 36 |