dax divide formula
5 TopicsMeasure to show % of shop type product is sold in when filtered by product
Trying to write a measure where if i filter by a product it gives me what % of that store type the product is sold in, my data looks like so with this kind of being the output (or at least i can pull the measure into a table and calculate/count it etc)Solved1.8KViews0likes15CommentsDAX measure does not return the same value more than 1 time
Hey everyone, So, the problem is that a fairly simple measure does not return a value twice or more if the value of 'Measure 1' is same: MFR = DIVIDE ( SELECTEDVALUE('Table'[FR]), 12 ) As you can see, after returning 8 once, it doesn't do anything until it gets 9, then 10. There are three 10 values, and it returns only one of them. Same issue with other values. How do I fix it so it could return values?Solved664Views0likes2CommentsTable Filter not working when using measure
Hi everyone, when I am using the following measure: LM Change = SWITCH( TRUE(), ISBLANK([LM CY]) && ISBLANK([LM PY]), blank(), DIVIDE( [LM CY], [LM PY], "" )-1 ) I get the following table that outlines last month sales of the current year, it's corresponding sales in the previous year and the percentage change between these two figures per account: However, when I would like to split each account sales by country by dragging it in the rows-section of the visual, it says Can anyone please help me understand and solve this error? Thank you in advance!Solved783Views0likes3CommentsCalculation group does not properly aggregate measures created using DIVIDE()
Calculation groups in Analysis Services (AS) are incredibly powerful for doing quick rolling 12 month (R12) type aggregations to smooth trend data (among many other cool things that calculation groups do). After applying the R12 calcuation group, the measure for each month is immediately changed to a sum of the measure for the current month and the 11 prior months. A large number of the pre-defined measures in our primary tabular AS database are simply ratios defined using the DIVIDE() function (effective rates, margins, etc.). When Power BI (or Excel) grand totals such a measure in a report (no calculation group involved), it is smart enough to sum the numerator and denominator and then do the division (because you can't just add up the result of the division on each detail line). This is really a wonderful feature that takes a big headache out of reporting. But the same does not seem to happen with a measure aggregated using my rolling 12 month calculation. Instead it simply adds the result of the division for each month. I am wondering if I am doing the calculation in a way that confuses the engine. Here is the DAX from the calculation group for a rolling 12 calculation: CALCULATE ( SUMX ( VALUES ( 'Date'[Date]), SELECTEDMEASURE () ), PARALLELPERIOD(DATESINPERIOD ( 'Date'[Date], MAX ( 'Date'[Date] ), -12, MONTH ), -1, MONTH) ) I can create specific R12 calculated measures for each ratio measure (by manually applying the above calculation to the numerator and to the denominator separately and then dividing) but we have a lot of them and it is a shame to create so many extra measures in a piecemeal fashion just because calculation groups do not appear to work for these measures. Thanks in advance!Solved2.5KViews0likes3CommentsDAX Divide Formula
Hi, I want DAX formula for Divide, it likes, 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 dates = (VALUES ( 'Production of the day'[actualendtime] ), 1 = totals selected no. of days minus 1 day (it is value not text), No. of Sundays in selected period = no. of sundays( how should i write DAX for no. of Sundays only)Solved6.3KViews0likes3Comments