hasonevalue
4 TopicsIs this a bug or something? (Using IF, HASONEVALUE and BLANK functions)
I have a measure formula like this: IF(HASONEVALUE([column_name]) , SUM([other_column_name]) , BLANK() ), so it should give the sum of the other column when the current context is one row and give blank when the current context includes more than one row. Though, when I add this measure to a visual, it doesn't allow me to include this measure in values. If I change "BLANK()" for 0 or 1, it plots the measure values without any problem. Why could this happen?1.2KViews0likes2CommentsDATESBETWEEN function applied to a measure
Hi, Is there a way to apply a datesbetween function to this measure? % Sum = IF(HASONEVALUE('Sort Table - Month Year'[Month Year]),[Measure 3], SUMX( ALLSELECTED('Sort Table - Month Year'), [Measure 3] )) I've tried this but it doesn't seem to be working: % Attendance Sum 2018 = IF(HASONEVALUE('Sort Table - Month Year'[Month Year]),[Measure 3], CALCULATE(SUMX( ALLSELECTED('Sort Table - Month Year'), [Measure 3] ),DATESBETWEEN('DimDate'[Dates],DATE(2018,1,1),DATE(2018,12,31)))) Thanks in advance for any help1.1KViews0likes2CommentsMeasure Subtotals in Matrix not working for both Rows and Columns
hello, I added this Measure in a Matrix, which calculates the transactions volume by hour: Total Transactions = AVERAGE(table1[percentage_by_hour]) * sum(table2[transaction_value]) "table1" has the percentage distribution of transactions by hour, as shown below: hour % channel 1 1% Channel A 2 2% Channel B 3 8% Channel A ... .... .... "table2" has the total volume of transactions for the day, by Channel: day channel transaction_volume feb 1 Channel A 100 feb 2 Channel B 40 ... .... The Matrix has 'Hours' in the columns and 'Channels' in the rows and for some reasons only either the rows subtotal or columns subtotal is showing correctly, but not both together. This is the Measure that I used in the Matrix to show results: Total Transactions NEW = VAR monthlyAverages = AVERAGEX(VALUES(table2[Channel]),[Total Transactions]) VAR AverageTotal = summarize(table2,table2[Channel],"Monthly AVG",monthlyAverages) RETURN if(HASONEVALUE(table2[Channel]), monthlyAverages, sumx(AverageTotal,[Monthly AVG])) This is working by 'Channel', therefore the rows subtotal is correct, but the columns subtotal is wrong. If I replace 'Channel' with 'Hour' the opposite will happen (columns subtotal is correct, and rows subtotal is wrong). How can I make it work so both rows subtotal and columns subtotal show correctly? thanks!4KViews0likes5Comments