Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
robarbie
Helper I
Helper I

How do I create a Dax formula with a date value as the denominator?

I have a requirment where the vendor wants a measure divded by the month number.

 

"Abs Perc of Error (Demand Forecast) / by the month number Example:  Jan Abs Perc of Error (Demand Forecast) / 1, Feb Abs Perc of Error (Demand Forecast) / 2, etc"

 

When I try to create the DAX Measure the date denominator will not poplulate or if I try to use Quick Measure it wants to add sum 

or another aggregation.

 

This a quick measure: 

Demand Forecast divided by MonthNum =
DIVIDE([Demand Forecast], SUM('DimDate'[MonthNum]))
 
Any guidance would be apprciated!
 
3 REPLIES 3
Nathaniel_C
Super User
Super User

Hi @robarbie , how is your month number column formatted? As a whole number?
Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hi Nathaniel,

It is formatted as a whole number.

 

Thanks,

 

Rochelle

Hi @robarbie , since DAX needs to know which row to use in a table, it won't let you put in a "naked" column because there are multiple values.  I typically use MAX(), but most of the time you could use MIN() as well.  Since in a typical calculated column, the engine knows what row it is on the MAX() works fine.

 

Demand Forecast divided by MonthNum =
DIVIDE([Demand Forecast], MAX('DimDate'[MonthNum]))
Try this and let us know if it works.  If not, you may need to provide a bit more about your report.


Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors