The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi,
I'm connecting to a big table using direct query. I've to create a average measure based on a table which is working perfect.
BID_VOL =
var avg_bid_avail = CALCULATE(AVERAGE(dataSAMPLE[BID_AVAIL]), FILTER(dataSAMPLE, dataSAMPLE[BID_VOLUME] <> 0))
var AVG_BID_VOLUME = CALCULATE(AVERAGE(dataSAMPLE[BID_VOLUME]), FILTER(dataSAMPLE, dataSAMPLE[BID_VOLUME] <>0))
return IF(MAX(DATAAVAILABLE[dataavailable]) = "ALL", AVG_BID_VOLUME, avg_bid_avail)
Then i've to create running total based on the outcome of this data. I created a measure for it.
BID_VOL running total in STATION_NAME =
CALCULATE(
[BID_VOL],
FILTER(
ALLSELECTED(dataSAMPLE[STATION_NAME]),
ISONORAFTER(dataSAMPLE[STATION_NAME], MAX(dataSAMPLE[STATION_NAME]), DESC)
)
)
I am getting the below output but this is not what i am expecting.
I want an output like below.
I've added a sample pbix file for your review. Can you please help what would be the dax for it?
https://drive.google.com/file/d/1xYA-r3hxRrydQ_a_qc16NNnQWt_dpi-k/view?usp=sharing
Please note it's a direct query and connecting to big table. So, adding calculated column or adding index column in power query mayn't help.
Regards,
Laiq
Solved! Go to Solution.
Hi @Laiq_Rahman
Try the following code:
BID_VOL running total in STATION_NAME = SUMX(
SUMMARIZE(
FILTER(
ALLSELECTED('dataSAMPLE'),
'dataSAMPLE'[STATION_NAME] <= MAX('dataSAMPLE'[STATION_NAME])
),
'dataSAMPLE'[STATION_NAME],
"D", [BID_VOL]
),
[D]
)
File attached.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @Laiq_Rahman
Try the following code:
BID_VOL running total in STATION_NAME = SUMX(
SUMMARIZE(
FILTER(
ALLSELECTED('dataSAMPLE'),
'dataSAMPLE'[STATION_NAME] <= MAX('dataSAMPLE'[STATION_NAME])
),
'dataSAMPLE'[STATION_NAME],
"D", [BID_VOL]
),
[D]
)
File attached.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsAwesome. I've spent days to figure out. Problem solved now.... Thank you so much.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
80 | |
75 | |
52 | |
50 |
User | Count |
---|---|
133 | |
124 | |
78 | |
64 | |
61 |