The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I have created a measure that compares two dates that have been selected by the report user; however, one of those dates a month is a baseline of a consensus forecast, the others are the daily operational numbers. In order for the users to have handy what they picked I've created the measure below as a "tag" so it displays the dates selected.
VAR Max_Date_of_Selection = CALCULATE(max(Daily[Capture_Date]),ALLSELECTED(Daily))
VAR Min_Date_of_Selection = CALCULATE(min(Daily[Capture_Date]),ALLSELECTED(Daily))
VAR No_of_date = DISTINCTCOUNT(Daily[Capture_Date])
Return
if( No_of_date = 2, Max_Date_of_Selection&" vs "& Min_Date_of_Selection, "Please select two Dates")
this gives a Max Date vs Min Date result, but it doesn't say it is a consensus forecast and daily numbers. So I would like to use one column I have for the extract type that calls out whether it is one or the other. So let's say that 7-01-2022 is the consensus and we are comparing it to today's date: 7-14-2022 I would like to know if instead of retrieving the max/min date - when the two dates are selected it - can actually return for max Daily and Min Consensus, so it displays like this: Daily vs Consensus.
Any thoughts?
Hi @Chava1881 ,
I think you need create a new date table which has no relationship with fact table.
Then use this measure to do that.
Measure =
var _date1 = SELECTEDVALUE(Dim_date_new[Date])
var _date2 = SELECTEDVALUE(Dim_date[Date])
return
IF(not( OR( ISBLANK(_date1),ISBLANK(_date2))),_date1&" vs "&_date2,"please select two dates")
Result:
Pbix in the end you can refer.
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
that's what I currently have, I would like to get the data type instead. Not the dates.
PBIX is here.
Tag Selected Dates =
var mx = max(IBP_Daily[Capture_Date])
var mxl = CALCULATE(max(IBP_Daily[Data_Type]),IBP_Daily[Capture_Date]=mx)
var mn = min(IBP_Daily[Capture_Date])
var mnl = CALCULATE(max(IBP_Daily[Data_Type]),IBP_Daily[Capture_Date]=mn)
return if( countrows(filters(IBP_Daily[Capture_Date])) = 2,mxl &" vs "& mnl, "Please select two Dates")
Please provide sanitized sample data that fully covers your issue. If you paste the data into a table in your post or use one of the file services it will be easier to assist you. I cannot use screenshots of your source data.
Please show the expected outcome based on the sample data you provided. Screenshots of the expected outcome are ok.
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523