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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
mdykes
Frequent Visitor

Need some DAX code assistance please!

Hi,

 

I am having some issues with cross column multiplication based on a date filter and a measure. I am requring a column that contains multiple rows of numerous values to be multiplied by a measure. This measure has been filtered by the same thing that the new column will be filtered with. I have tried doing sumx and a filter combined together. Although, I am having little luck. 

 

 

The Total_Fuel_Consumed is the outcome. The Fuel Consumption (L/Hr) is the column that needs to be mulitplied with the measure. The measure is a value of hours for specific items, which it is filtered by a specififed date. Example of table and slicer (below) in reproting view, containing measurement (SMU Total) and corresponding plant_no. 

 

If someone could assist that would be awesome!

2 REPLIES 2
amitchandak
Super User
Super User

@mdykes ,The information you have provided is not making the problem clear to me. Can you please explain with an example.
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
Appreciate your Kudos.

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi Amit, I hope this may help clarify.

 

Query 1 is a query containg the tables in the Example. Query 2 is a query containing different information. Currently, the Machine Hour reading table (Screenshot below) is a Measure that is visible in the visualisations tab of Power Bi and contains an Hour reading corresponding to the Machine with a date acting as a filter. This allows me to sum a reading based on a filtered date and corresponding Machine. 

 

The code for this Sum calc for the Hours is below, date filter created with relationship

Hour Total = SUMX(VALUES('XXXXX Vehicle Information'[machine]),[Hour total calc]) ---> 'Measure'

 

mdykes_2-1613346822263.png

 

 

The outcome required is a mulitplication of the Fuel consumption rate column and the Machine Hour reading 'Measure' to create a Fuel used column filtered by a date. This would give a summed value. Would this be a measure?

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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