Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
I have a slicer on a Date table named Dates. The date table is not linked to anything, it is just used to help populate the values of various measures used in another table, currently called Query2.
An example of one of my measures is below and updates as expected if the slicer on the 'Dates' table changes.
My First Measure = CALCULATE(COUNTROWS(Query2), FILTER(Query2, Query2[Date_Placed] >= MIN('Dates'[Date]) && Query2[Date_Placed] <= MAX('Dates'[Date])))
My table visualization displays the measures correctly as separate columns. If I adjust the slicer, the table updates as well. Now, I want to combine all of the measures into one column. I've tried the following but it does not take into affect the slicer. It pulls the static data from when the report loaded and I get incorrect values that do not update as the slicer changes.
Table =
Var t1 =
summarize(DISTINCT(query2), Query2[Category], Query2[Type], "Measure", "My First Measure", "Totals", [My First Measure])
Var t2 =
summarize(DISTINCT(query2), Query2[Category], Query2[Type], "Measure", "My Second Measure", "Totals", [My Second Measure])
RETURN UNION(t1,t2)
Any help on how I can throw all my measures into one column and still retain the dynamic value influenced by the Slicer?
Solved! Go to Solution.
Hi @TCavins ,
you can add the categories on the rows of the matrix visualization and the information will be presented has you need:
Second inmage is turning off the stepped layout.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHI @TCavins,
As MFelix said, measures are content-based expressions.
If you use them to calculate column/table, their row contents will be fixed and not dynamically calculated with row contents and correspond filter effects.
For your requirements, you can create an attribute table with all measure names.
Then you can use this new field on matrix row, use a measure expression to replace the raw value field to return correspond results based on current category values.
My Favorite DAX Feature: SELECTEDVALUE with SWITCH
Regards,
Xiaoxin Sheng
HI @TCavins,
As MFelix said, measures are content-based expressions.
If you use them to calculate column/table, their row contents will be fixed and not dynamically calculated with row contents and correspond filter effects.
For your requirements, you can create an attribute table with all measure names.
Then you can use this new field on matrix row, use a measure expression to replace the raw value field to return correspond results based on current category values.
My Favorite DAX Feature: SELECTEDVALUE with SWITCH
Regards,
Xiaoxin Sheng
Hi @TCavins ,
You cannot use measure to create tables or column into your model. Measures are context based and only calculated at the time you call them. This means that if you want to calculate the sum of a value using the slicers and filters the calculation is made.
Calculated columns are row based and the context is of the table they are.
What is the purpose of this table that you are creating? is to have the visualization of those measure in a single column on the same visualization
If this is the purpose use a matrix and then on the options turn on the Show on Rows that will create a matrix but the measures will be presented on rows as you can see below:
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsIt's closer to what I want.
Category 1
Measure 1 12
Measure 3 18
Category 2
Measure 1 13
Anyway to now split the measures into a column next to the Category and totals after that?
Hi @TCavins ,
you can add the categories on the rows of the matrix visualization and the information will be presented has you need:
Second inmage is turning off the stepped layout.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsUser | Count |
---|---|
126 | |
108 | |
99 | |
65 | |
62 |
User | Count |
---|---|
137 | |
116 | |
102 | |
71 | |
61 |