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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
DataSciWannabe
Frequent Visitor

Measure Calculate Based Off Expression

Hello,

 

I was hoping to get help writing a formula that would calculate based off the results of another expresion.

 

The data looks like the below except 2MM+ rows

NameDateSalesQty
a12/1/201830010
b12/1/2018  
c12/1/201820012
d12/1/201850017
a1/1/20191005
b1/1/201960020
c1/1/201950014
d1/1/201990025

 

 

I have a measure that calculates the price (Sales/Qty) and then one that calculates the change in price based off of two slicers for a beginning and end date. If there is no data in either the beginning or the end month (see the b name 12/1/2018), there is no ability to return a price change, so it is marked as a blank.

 

I would like to be able to return the total of sales from the date 

 

I have the measure below which calculates the sales total for values being captures, I want to adjust it for an additional filter where the value of the Blank Measure = 1, but nothing I try seems to be working

 

Sales Measure

CALCULATE([Sales],DATESBETWEEN('Calendar'[Date],VALUES(Beg_Slicer[Beg. Date]),VALUES(End_Slicer[End Date])))

 

Blank Measure

sumx(values('data'[name]), if([Price_Chg] = "",1,0) )

 

thanks all

1 REPLY 1
Anonymous
Not applicable

Do you have Date/Calendar table? If so, is it marked as a Date Table in data view?  DATESBETWEEN is a time-intelligence function that requires a Calendar table to work correctly. If you dont have one, can make on pretty easily. But that would be initial step here I feel to troubleshoot your problem. 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.