Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi All,
I am using a measure that results in a text string to filter values in a column.
This is my DAX code, I am using the measure [Selected Report Period 1] which results in a text string to add only the values in the column with the resulting text string:
Thank you @parry2k and @mochabits for the quick response!
I used SELECTEDVALUE and yes it worked. But probably I might have a greater problem here because I am not able to arrive at my desired solution yet.
What I wanted to do is for each of the Revenue Categories shown in the Matrix rows below, I want to show a Gross Revenue totals column filtering the rows only for the selected Report Period (I will ultimately remove the Report Period field in the Matrix to show only Revenue Categories). I want the Report Periods to be dynamic, that is why I am using a measure in the FILTER condition.
My ultimate goal is to add a column calculating the variance/difference between Gross Revenue 1 and Gross Revenue 2 columns. I also did not discover a fix to Calculating Column Grand Totals in a Matrix table as a Difference. Hence, I resort to writing a measure for Gross Revenue for each Report Period.
Below is also a screenshot of my Revenue (TH) table and table relationship diagram. Would really appreciate your help to resolve this as I have been trying to figure this out for a week now and can't do anything else. 😞
@Anonymous Since you want the report period to be the slicer, you don't need to explicitly specify it in the measure. So do you have a flag or column to indicate gross revenue 1 and 2?
If yes, your two measures will be like
gross_rev_1 := calculate (gross revenue), filter ([revenue_type] = 1)
, and the other is -
gross_rev_2 := calculate (gross revenue), filter ([revenue_type] = 2)
The third measure will be like
variance := gross_rev_1 - gross_rev_2
Hi @Anonymous,
did you get a chance to solve this problem? I'm facing the same problem and i'd like to know how did you get though this
@Anonymous
[Selected Report Period 1] = selectedvalue('Revenue (TH)'[Report Period])Try using selectedvalue() instead of values()
@Anonymous based on your explanation it should work, not sure what is going on there. try changing following measure and put this measure on a KPI card to see what value you get, just to confirm you are getting selected value.
[Selected Report Period 1] = SELECTEDVALUE('Revenue (TH)'[Report Period])
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
User | Count |
---|---|
102 | |
92 | |
85 | |
78 | |
71 |
User | Count |
---|---|
113 | |
104 | |
101 | |
73 | |
65 |