Forum Discussion
hstgeorge
5 years agoHelper III
Help Needed for Calculation
I have a data set that is set up so that one column contains one of the following: Gallons, Revenue, Fees, Discount and another column next to it that contains the value. I would like to divid...
- 5 years ago
Hi hstgeorge
Here's a sample PBIX with data and DAX Code
Try this measure
Ratio = DIVIDE( SUM('Table'[Amount]), CALCULATE( SUM('Table'[Amount]), FILTER(ALL('Table'), 'Table'[Type] = "GALLONS")))You should get this
Regards
Phil
amitchandak
5 years agoSuper User
hstgeorge , Create a measure like
divide(calculate(sum(Table[Amount]), filter(Table, Table[Type] ="GALLONS")),calculate(sum(Table[Amount]), filter(Table, Table[Type] <>"GALLONS")))
hstgeorge
5 years agoHelper III
When I type that calc and then use line items in the row to show revenue and then put in the measure so it should divide revenue by gallons, it shows zero or blank but has a value in the total. Any other suggestions