Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply

Conditional measure

Hi Guys,

 

I have come across a rather interesting situation. I have a table in which I have an ACCOUNT column. It is mapped with the other table (name_entity column).
In the matrix in the rows I have values from the name_entity column. I need to write a measure that conditionally, for all rows will take some there specified value, and for one particular one, say “% of Cash Invested” will take dividing values from two other rows “Total Average Cash” and “Cash Invested” which are counted by this measure.

KamilRetkiewicz_1-1729338371129.png
AVG_CASH_PERCENT_BUD = IF(SELECTEDVALUE(AVG_CASH_ACT[CATEGORY]) = "% of Cash Invested", FORMAT([AVG_CASH_BUD], "0%;(0%);-"),[AVG_CASH_BUD])
 
AVG_CASH_BUD =
VAR __BUD = CALCULATE(SUM(AVG_CASH_ACT[AMOUNT]),
                    AVG_CASH_ACT[SCENARIO] = "Budget")
VAR __BUD_YTD = TOTALYTD(CALCULATE(SUM(AVG_CASH_ACT[AMOUNT]),
                    AVG_CASH_ACT[SCENARIO] = "Budget"),'Calendar'[Date])
VAR __MONTH = SELECTEDVALUE('Calendar'[MonthNo])
RETURN
IF(MAX('AVG_CASH_ACT'[CATEGORY]) in {"Net Interest (Cumulative)", "Interest on debt","Interest on deposits"}, __BUD,__BUD_YTD/__MONTH)
 
 
 

As you can see, it should come out 73%. How to do this?

 

 

 

 

1 REPLY 1
danextian
Super User
Super User

Hi @KamilRetkiewicz 

 

As always, please a workable sample data and your expected result from that. It is hard to figure out what you want to achieve from the  description alone.  https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447... 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors