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! Get ahead of the game and start preparing now! Learn more
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! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 40 | |
| 36 | |
| 33 | |
| 29 | |
| 26 |
| User | Count |
|---|---|
| 135 | |
| 103 | |
| 65 | |
| 61 | |
| 55 |