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
David_1970
Frequent Visitor

Creating measure

Hi,

 

The table below show gross revenue and disbursement for a lot of projects (only one shown though).  On my report canvas I want a slicer where I can toggle between Gross Revenue and Net Revenue, where Net Revenue should be calculated as Net Revenue = Gross Revenue + Disbursement.

 

I imagine I should create a New Measure but since Power BI and DAX is quite new to me I can't find out how.

 

Any ideas?

 

Table1

ProjectTypeAmount
158894Gross Revenue2000
158894Gross Revenue1500
158894Gross Revenue1000
158894Disbursement-700
158894Disbursement-300
1 ACCEPTED SOLUTION
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @David_1970,

 

You need an extra table which contains only one column that will be added into slicer later. 

1.PNG

 

Create measures as below:

Gross Revenue =
CALCULATE (
    SUM ( 'revenue  table'[Amount] ),
    'revenue  table'[Type] = "Gross Revenue"
)

Net Revenue =
SUM ( 'revenue  table'[Amount] )

Revenue =
IF (
    LASTNONBLANK ( 'Slicer table'[Revenue Type], 1 ) = "Gross Revenue",
    [Gross Revenue],
    [Net Revenue]
)
Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @David_1970,

 

You need an extra table which contains only one column that will be added into slicer later. 

1.PNG

 

Create measures as below:

Gross Revenue =
CALCULATE (
    SUM ( 'revenue  table'[Amount] ),
    'revenue  table'[Type] = "Gross Revenue"
)

Net Revenue =
SUM ( 'revenue  table'[Amount] )

Revenue =
IF (
    LASTNONBLANK ( 'Slicer table'[Revenue Type], 1 ) = "Gross Revenue",
    [Gross Revenue],
    [Net Revenue]
)
Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi and thanks!

 

However, I also seem to get a (blank) tick box option in my slicer on the canvas in addition to the gross revenue and net revenue tick boxes. And revenue is only shown in the card visual when the (blank) tick box is selected, otherwise no revenue is shown.

 

I guess I have to do some trouble shooting.

 

Once again, many thank's.

vanessafvg
Community Champion
Community Champion

@David_1970 to toggle look at the tecnique in this video from  time 11:37

 

https://www.youtube.com/watch?v=Mpk9Js5jUeg

 

to create the measure

 

Net Revenue = sum(Gross Revenue) + sum(Disbursement)

 





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




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 Fabric 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.