Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello,
I have a grid with columns A, B, C and D with a single meassure
I want follwing behavior:
If GRID has only Column A then show meassure M1
If GRID has Column "A" with any other column(s) then show meassure M2
If grid does not have Column "A" then show meassure M2.
M1 = SUM(Salary)
M2 = SUM(Bonus)
Thanks.
Hi @oracledw ,
Sorry to disturb you...
But did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please upload some insensitive data samples and expected output.
Best Regards,
Eyelyn Qin
Hi @oracledw ,
You could firstly unpivot other columns then use the following formula, or take a look at my pbix file here:
flag =
SWITCH ( 'CateSlicer'[Cate], "A", 0, 1 )
Measure =
VAR _sum =
CALCULATE ( SUM ( CateSlicer[flag] ), ALLSELECTED ( CateSlicer[Cate] ) )
RETURN
IF (
_sum = 0,
CALCULATE (
SUM ( 'Table'[Value] ),
FILTER ( 'Table', 'Table'[Cat] = "Salary" )
),
CALCULATE ( SUM ( 'Table'[Value] ), FILTER ( 'Table', 'Table'[Cat] = "Bonus" ) )
)
Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please upload some insensitive data samples and expected output.
Best Regards,
Eyelyn Qin
@oracledw You could try this measure:
Checked Measure =
VAR _a =
SELECTEDVALUE ( Table[ColumnA] )
VAR _b =
SELECTEDVALUE ( Table[ColumnB] )
VAR _c =
SELECTEDVALUE ( Table[ColumnC] )
VAR _d =
SELECTEDVALUE ( Table[ColumnD] )
RETURN
IF (
ISBLANK ( _a ) = FALSE ()
&& ISBLANK ( COALESCE ( _b, _c, _d ) ),
[M1],
[M2]
)
Respectfully,
Zoe Douglas (DataZoe)
Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/
@DataZoeProblem is I only mentioned 4 columns, there could be 20-30 columns if not more user can bring to grid.
Proud to be a Super User!
Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882
Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.
@oracledw , what is grid here , is it table or slicer. We can check the selected value and can change the measure calculation
example measure
if(selectedvalue(Table[Column]) ="A", [M1],[M2]_
See if this example matches on what you want -https://community.powerbi.com/t5/Desktop/Slicer-MTD-QTD-YTD-to-filter-dates-using-the-slicer/td-p/50...
@oracledw , If Column A is a column (Column Name is A). I doubt it is possible.
If it is A value in column
Example
Column
-----------------
A
B
Then we can create a measure dependent on these values.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
99 | |
82 | |
70 | |
60 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |