Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by watching the DP-600 session on-demand now through April 28th.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
I want DAX formula for Divide,
it's like, Measure = No. of product / (no. of days between two dates - 1 - No. of Sundays in selected period)
Measure =
COUNT('Production of the day'[productshortname]) / (VALUES ( 'Production of the day'[actualendtime] )- 1 - no. of sundays)
how should i write Correct fromula for this.
Here is context of each term,
No. of product = COUNT('Production of the day'[productshortname]),
no. of days between two selected dates = (VALUES ( 'Production of the day'[actualendtime] ),
1 = totals selected no. of days minus 1 day ( 10 -1=9; 10 - totals selected no. of days between dates ),
No. of Sundays in selected period = no. of sundays( how should i write DAX for no. of Sundays between selected date only)
@Anonymous
Each DAX function has input arguments with their correct types and output with the correct type. When you pass something to a function, you have to obey the rules of syntax and types. It's like in mathematics: you can't expect that adding a set to a number will yield something meaningful - they are different objects and the "+" operation is not defined for them. VALUES, as already pointed out, is a TABLE FUNCTION, not a scalar, so you can't put it under DIVIDE which expects 2 scalars.
You probably fish for something like:
[Measure 4] =
DIVIDE(
DISTINCTCOUNT( 'Production of the day'[productshortname] ),
DISTINCTCOUNT( 'Production of the day'[actualendtime] )
)
If you're not sure about a function, go to http://dax.guide and look for it (there's a Search box on the left-hand side). Then pay attention to the input and output.
Hi @Anonymous
VALUES is a table function. What are expecting the following argument to return
VALUES('Production of the day'[actualendtime])
What is the content of the 'Production of the day'[actualendtime] column?
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 7 | |
| 5 | |
| 4 | |
| 2 | |
| 1 |
| User | Count |
|---|---|
| 16 | |
| 8 | |
| 7 | |
| 7 | |
| 6 |